Skip to content

bug(mcp): orchestration_wait_agents reply is lost when the caller backgrounds a long wait #827

Closed

Description

@Juliusolsson05

Expected behavior

A caller of orchestration_wait_agents with a long timeout receives the result when the children finish, or a bounded "still running" reply it can poll on.

Actual behavior

On 2026-09-05T23:28Z a Claude session waited on a two-child run with a generous timeout. The harness moved the MCP call to the background at 120 s; the MCP transport then dropped mid-call and the tool's response was lost (MCP server "agent_code" transport dropped mid-call; response for tool "orchestration_wait_agents" was lost). The children were unaffected. A retry with a 100 s timeout returned normally.

Impact

Any orchestration flow that waits longer than the harness's backgrounding threshold silently loses its wait result and must fall back to polling orchestration_list_agents. Developer-experience reliability failure in a first-party MCP surface.

Proposed fix

Cap the server-side wait below the harness threshold (90 s) regardless of the requested timeout and return { timedOut: true, agents: [...] } so callers poll; document the cap in the tool description.

Environment

Agent Code 0.0.2-beta.1 (main at 5d64184 at the time), Claude Code harness with a 120 s foreground tool limit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions