fix(mcp): launch parallel children before waiting#23241

open2
main
fix/issue-23191
opened1d agobyJJulius Marminge
View on GitHubTwo-way sync enabledPR last imported 22h ago

Problem

Submitting two delegate_task calls with mode:"wait" together can delay the second launch until the first wait returns because the provider's MCP client serializes the calls. The guidance did not explain this or require launch confirmation before reporting a child as running.

Change

Tell agents to launch all parallel children with mode:"async", retain the returned task IDs, and confirm launch responses before describing children as running. Apply the guidance to orchestration instructions, the tool description, and the mode parameter description.

Scope and approval

Fixes #23175 GitCafe: https://git.cafe/pingdotgg/t3code/issues/23191 Triaged bug via the automated issue flow. Guidance only; no scheduling or wire-schema changes.

Verification

  • vp test run apps/server/src/provider/CodexDeveloperInstructions.test.ts: 16 tests passed on the final head, including the instruction byte limit and delivery order.
  • Scoped lint, formatting, and git diff --check: passed.
  • Two independent diff reviews: MERGE, no confirmed findings.
  • Runtime probe: Codex gpt-6.1-sol; two batched 10-second waits with children running sleep 15. B's tool call started 74 ms after A's wait returned. With async launches, both responses confirmed running task IDs within 795 ms. These baseline probes used the installed host.
  • Fixed current-main dev build: actual provider context and MCP tools/list expose all three updated guidance surfaces; two async child launches completed before status checks.

Runtime evidence index, sanitized fixed-build transcript, and proof matrix.

No visual paths changed; the visual fixture matrix is empty. No new unit test was added: the serialization occurs in the provider's MCP client before the second request reaches T3, and a source-string assertion would only repeat the guidance. Runtime verification used Codex; Claude direct parallel tool use was not independently rerun.

Models: GPT-6.1-Sol and Claude Opus 5.5. Harness: T3 Code through Codex and Claude Code.

Checks

All checks passed

Added 2 commits

  • Merge remote-tracking branch 'origin/main' into fix/issue-231915f90bd3
  • fix(orchestration): launch parallel delegated children async before waitingec336f2
Synced from GitHub

Approvability

Verdict: Approved at 5f90bd3

Macroscope's review found this PR approvable — This small bug fix updates the existing orchestration guidance so parallel child tasks launch asynchronously before any blocking waits, without changing schemas, defaults, or execution infrastructure. The runtime impact is narrow and self-contained.

You can add or adjust custom eligibility rules. Learn more.

Synced from GitHub

Thread transfer impact

✅ Thread transfer remains within every enforced ceiling.

ProviderMetricMain baselineThis PRImpactPR ceiling
CodexTotal thread wire5.0 KiB5.0 KiB+7 B (+0.1%)6.8 KiB✅
CodexThread snapshot wire3.8 KiB3.8 KiB0 B (0.0%)4.9 KiB✅
CodexLive turn WebSocket wire1.2 KiB1.2 KiB+7 B (+0.6%)2.0 KiB✅
CodexLive turn WebSocket decoded20.9 KiB20.9 KiB0 B (0.0%)29.3 KiB✅
CodexLive turn messages220 (0.0%)8✅
ClaudeTotal thread wire5.0 KiB5.0 KiB0 B (0.0%)6.8 KiB✅
ClaudeThread snapshot wire3.8 KiB3.8 KiB0 B (0.0%)4.9 KiB✅
ClaudeLive turn WebSocket wire1.2 KiB1.2 KiB0 B (0.0%)2.0 KiB✅
ClaudeLive turn WebSocket decoded21.2 KiB21.2 KiB0 B (0.0%)29.3 KiB✅
ClaudeLive turn messages220 (0.0%)8✅

Baseline: 6318bfc · PR result: 5f90bd3 · Source CI: success

Scenario and decoded snapshot size

10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.

  • Codex decoded thread snapshot: 108.5 KiB
  • Claude decoded thread snapshot: 108.8 KiB

Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed.

Synced from GitHub

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Path: .coderabbit.config.ts
  • Review profile: CHILL
  • Plan: Team
  • Run ID: daf8ed5a-6ecc-4eb1-8146-9d8eafe630ec
📥 Commits

Reviewing files that changed from the base of the PR and between 6318bfc597e544679848c4ed816606bacd32a175 and 5f90bd3add7ede32d1fa75c2c298a324d4629d45.

📒 Files selected for processing: 3
  • apps/server/src/mcp/toolkits/orchestrator/tools.ts
  • packages/contracts/src/orchestratorMcp.ts
  • packages/provider-core/src/server/orchestrationInstructions.ts

Limit details: You’ve used all 10 included reviews currently available.

📝 Walkthrough

The delegate_task descriptions and orchestration instructions now direct callers to launch parallel children asynchronously before waiting, retain returned task IDs, and confirm launches before describing children as running.

Changes: Parallel delegated-task guidance

Layer / File(s)Summary
Asynchronous launch instructions
apps/server/src/mcp/toolkits/orchestrator/tools.ts, packages/contracts/src/orchestratorMcp.ts, packages/provider-core/src/server/orchestrationInstructions.ts
The tool descriptions and orchestration instructions document asynchronous launches before blocking waits, task ID retention, and launch confirmation. They also note that MCP clients may serialize batched wait calls.

Priority: ⬇️ Low

Estimated code review effort: 1 (Trivial) | ~5 minutes

Change: Bug fix

Possibly related issues

  • pingdotgg/t3code#23175 — The issue reports that batched delegate_task calls in wait mode can start sequentially. This change advises launching children asynchronously before waiting.

Suggested reviewers: gustavonline, lastobelus

Merge Risk: ⚪ Minimal · up to 5f90b

The guidance matches the task-management flow, and no concrete merge-blocking risk is established.

Pre-merge checks: Passed 4
Check nameStatusExplanation
Title checkPassedThe title clearly and concisely describes the main change: launching parallel MCP children before waiting.
Linked Issues checkPassedCheck skipped because no linked issues were found for this pull request.
Out of Scope Changes checkPassedCheck skipped because no linked issues were found for this pull request.
Description checkPassedThe pull request includes all required sections. It clearly describes the problem, the guidance-only change, scope references, focused verification results, limitations, and agent details. The verific…
Full details: Description check

Explanation

The pull request includes all required sections. It clearly describes the problem, the guidance-only change, scope references, focused verification results, limitations, and agent details. The verification section provides specific commands and observed runtime results.

✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.