Skip to content

fix(server): run a round's tools at most 16 at a time - #1596

Open
Aditya-thesys wants to merge 1 commit into
mainfrom
fix/server-tool-pool
Open

Aditya-thesys wants to merge 1 commit into
mainfrom
fix/server-tool-pool

Conversation

@Aditya-thesys

Copy link
Copy Markdown
Contributor

What it does better

A dashboard script can't make your backend run a large batch of your tools all at once: tools from one round run at most 16 at a time.

Problem

@openuidev/server runs each round's tool calls with Promise.all, so a round's whole batch starts at once. Today the SDK caps a run at 16 calls, so that's at most 16. With #1560 (the sandbox owns the limit; the SDK keeps a 256 backstop) an honest sandbox can send 48 in one round, and a misbehaving or compromised server up to 256, and every one of them would start at the same time against the developer's databases and paid APIs, on every query of every dashboard view. Found by a security review of #1560.

Fix

packages/server/src/tools/execute.ts: a small mapWithLimit pool runs a round's calls at most 16 at a time. The results go back in the same order as before, and a run that has timed out or been aborted starts no new tools.

Evidence

On #1560's code, a round of 64 calls ran with a peak of exactly 16 at once, results in call order; after a 20 ms timeout no 17th tool started. On main alone (16 calls per run) behavior is unchanged.

Tests

@openuidev/server: tsc clean, eslint clean, vitest 11/11. Changeset: @openuidev/server patch.

🤖 Generated with Claude Code

https://claude.ai/code/session_01DuFZ75cVMd52YVqv9C6XBF

A script round's whole batch ran at once with Promise.all, so a large batch (48 from an honest sandbox once the call limit rises, up to the SDK's backstop from a misbehaving server) started that many of the developer's tools simultaneously. A small pool caps it at 16, keeps the result order, and starts no more tools once the run is aborted or times out.
@vercel

vercel Bot commented Nov 9, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
openui-docs Ready Ready Preview Nov 9, 2026 11:53am UTC

Request Review

This branch was successfully deployed

1 active deployment
Preview — a756c7cf Deployed Nov 9, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant