Skip to main content
This agent reviews several documents at once. The lead hands each file to a helper (a subagent), each helper reviews only its own file with a clean context, and the lead merges the findings into one report. Helpers run three at a time, so any number of documents works. The same pattern works for contracts, pull request files, support transcripts, or competitor pages. You will use: subagents, a managed sandbox, and artifacts.
A managed sandbox uses machine time while it runs and needs your plan’s minimum balance of Orca credit in your wallet. Each helper makes its own model calls, so a review with helpers uses more tokens than one without.

How it works

multi_agent lets the lead delegate. It does not force it to, so the instructions say exactly when to delegate and what each helper must return. max_concurrent_subagents is a hard limit. Orca does not queue helpers: when the lead tries to start one more than the limit, that helper is refused with “Session subagent concurrency limit reached”. So the instructions tell the lead to start at most three helpers, wait for all of them, and then start the next batch. The program builds the limit and the instructions from the same MAX_HELPERS constant, so they stay in step. While it waits for a batch, the lead may end its turn with a short status instead of starting the next one. The turn still ends only after its helpers are done, and their results reach the lead in its next turn. So the program sends “Continue” until the report exists, up to five turns.

The program

Examples on this page assume the settings from the shared setup. It stages every .md file from a local docs folder into the sandbox.
Keep the documents small. Inline files travel in the request that creates the session, and that request is limited to 2 MiB, so all the documents together must stay well under that. For more, upload them and stage them by file_id. That avoids the request limit but not the staging limits: each staged file is at most 16 MiB however you send it, and everything staged into one sandbox at most 64 MiB. See size limits.

Make it yours

  • Give each helper a bounded task. “Review this file and return at most five findings” works better than “review this”. The lead only sees what helpers return, so ask for the evidence you want in the final report.
  • Set the concurrency for your budget. max_concurrent_subagents caps how many helpers run at once; it is 6 if you leave it out. Change MAX_HELPERS to change both the cap and the batch size in the instructions. Helpers cannot start helpers of their own.
  • Skip helper turns when you poll. If you wait by polling the turn list instead of streaming, helper turns appear there too. Skip turns with a subagent_id, as the quickstart does.
  • Delegation is not a security boundary. Helpers share the lead’s tools and sandbox. Give the lead only what every helper may use.