Repository navigation
fix(server): running delegates tell agents to end the turn - #24887
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ApprovabilityVerdict: Needs Human Approval Macroscope's review found this PR requires human approval — This small change updates the agent-facing running-delegate protocol and the default orchestration instructions used for MCP-enabled agents. Because it changes default product behavior, human review is required under the configured approval criteria. You can add or adjust custom eligibility rules. Learn more. |
Thread transfer impact✅ Thread transfer remains within every enforced ceiling.
Baseline: Scenario and decoded snapshot size10 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.
Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed. |
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Running-task polling guidance packages/contracts/src/orchestratorMcp.ts, apps/server/src/mcp/toolkits/orchestrator/tools.ts |
The running-task message says completion wakes the thread and directs callers not to wait or poll. The task-status description says not to query a running task before completion wakes the caller. |
Delegate cancellation guidance packages/provider-core/src/server/orchestrationInstructions.ts |
The instruction says to use task_cancel when replacing a delegate run or when it is no longer needed. The prohibition on using t3_thread_interrupt for a childThreadId remains. |
Priority:
Estimated code review effort: 2 (Simple) | ~8 minutes
Change: Bug fix
Possibly related PRs
- pingdotgg/t3code#24782: It adds the running-task message that this PR updates, alongside matching task-status guidance.
- pingdotgg/t3code#24850: It introduced the orchestration guidance that this PR refines.
- pingdotgg/t3code#21676: It changes cancellation finalization for delegated runs, related to this PR’s delegate-cancellation instruction.
Suggested labels: bugfix
Suggested reviewers: maria-rcks, macroscopeapp
Merge Risk: 
Minimal · up to 6c9ea
-
No actionable merge-blocking risk was identified.
Pre-merge checks: 
4
-
Full details: Description check
-
Explanation
The description includes the required Problem, Change, Scope and approval, and Verification sections. It explains the affected instructions, approval context, focused evaluation results, and test 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.
## What's Changed * fix(server): attachments are no longer silently dropped from prompts by @maria-rcks in pingdotgg/t3code#21356 * fix(mobile): images picked with choose files reach the agent as images by @maria-rcks in pingdotgg/t3code#21352 * feat(web): attach svg files to messages by @maria-rcks in pingdotgg/t3code#21355 * feat(server): send pdf attachments to claude and antigravity as documents by @maria-rcks in pingdotgg/t3code#21358 * feat(mobile): play audio inline and open shared files in the viewer by @maria-rcks in pingdotgg/t3code#21353 * feat(web): play audio inline and open any file the agent shares in the viewer by @maria-rcks in pingdotgg/t3code#21363 * perf(pull-requests): faster pull request timeline, code tab, summary and search by @maria-rcks in pingdotgg/t3code#22697 * perf(mobile): bound streaming markdown cache and pending work by @juliusmarminge in pingdotgg/t3code#24263 * fix(web): question options show a radio and an aligned shortcut key by @maria-rcks in pingdotgg/t3code#23255 * fix(server): notify parents after delegated background runs by @juliusmarminge in pingdotgg/t3code#23542 * fix(server): running delegates tell agents to end the turn by @t3dotgg in pingdotgg/t3code#24887 * perf(ci): cache server tests individually across shards by @juliusmarminge in pingdotgg/t3code#24966 * feat(mobile): one cached native-client install command for agents and machines by @juliusmarminge in pingdotgg/t3code#24965 * perf(source-control): pull request previews read only the pull request by @maria-rcks in pingdotgg/t3code#22583 * feat(infra): native client cache panels on the task cache dashboard by @juliusmarminge in pingdotgg/t3code#24994 * feat(web): UI design overhaul, with the new look behind a Beta toggle by @t3dotgg in pingdotgg/t3code#24865 * test(server): tests no longer depend on the host machine by @t3dotgg in pingdotgg/t3code#25001 * perf: opening a thread loads 85% less data by @t3dotgg in pingdotgg/t3code#24899 * fix(server): orchestrator records command count and duration again by @yordis in pingdotgg/t3code#23966 * fix(observability): every app reports its own environment and release channel by @yordis in pingdotgg/t3code#24340 * chore(lint): React effects can't grow past each file's budget by @juliusmarminge in pingdotgg/t3code#24964 * fix(observability): every exported resource names its service instance by @yordis in pingdotgg/t3code#23973 * fix(install): stable installs no longer fail behind a page of nightlies by @t3dotgg in pingdotgg/t3code#22907 * fix(server): Grok refresh no longer restores removed models from cache by @t3dotgg in pingdotgg/t3code#22849 * fix(server): resume fallback keeps the latest turn when an older handoff is pending by @t3dotgg in pingdotgg/t3code#22902 * fix(client-runtime): "Codex (hub)" badges read CH instead of C( by @t3dotgg in pingdotgg/t3code#22918 * fix(mobile): retain requested PR environment while connecting by @juliusmarminge in pingdotgg/t3code#24262 * fix(web): usage-limit banner reset time follows the Time format setting by @t3dotgg in pingdotgg/t3code#22915 * fix(web): terminal drag selection scrolls faster the farther past the edge by @t3dotgg in pingdotgg/t3code#22872 * fix(observability): resources add OTel semconv runtime and browser keys by @yordis in pingdotgg/t3code#23972 * chore(lint): main passes lint again with effects merged after the budget by @t3dotgg in pingdotgg/t3code#25055 * fix(server): ended roots no longer leave provider turns running by @t3dotgg in pingdotgg/t3code#22846 * feat(mobile): open threads and devices in a resizable iOS inspector by @juliusmarminge in pingdotgg/t3code#24985 * chore(web): measure renders before/after with render scenarios by @juliusmarminge in pingdotgg/t3code#24980 * fix(web): asset URLs re-mint per revision and before expiry without effects by @juliusmarminge in pingdotgg/t3code#24970 * fix(web): queued-message edits survive navigation and settle once by @juliusmarminge in pingdotgg/t3code#24972 * refactor(mobile): thread visits are tracked outside React by @juliusmarminge in pingdotgg/t3code#24973 * refactor(client): cloud account transitions run in one service by @juliusmarminge in pingdotgg/t3code#24974 * refactor(client): one VCS status refresh owner per checkout by @juliusmarminge in pingdotgg/t3code#24975 * refactor(web): document appearance and title are applied from app start by @juliusmarminge in pingdotgg/t3code#25004 * refactor(web): app shell shortcuts register once through one command dispatcher by @juliusmarminge in pingdotgg/t3code#25016 * refactor(web): shared intersection and document-activity stores by @juliusmarminge in pingdotgg/t3code#25020 * refactor(web): the theme store and diff worker pool stop syncing the theme through effects by @juliusmarminge in pingdotgg/t3code#25007 * fix(server): keep history discovery off the writer and pace compaction by @JustYannicc in pingdotgg/t3code#20877 * perf(mobile): compact persisted thread snapshots by @juliusmarminge in pingdotgg/t3code#24265 **Full Changelog**: pingdotgg/t3code@v0.1.3-nightly.20261025.3682...v0.1.3-nightly.20261025.3692 Upstream release: https://github.com/pingdotgg/t3code/releases/tag/v0.1.3-nightly.20261025.3692
Problem
In the MCP tool-use eval (#24635), GPT-6.1 Sol polled delegates that were still running. The old running-task
nexttext let it wait when it "needed the result now". Sol also left a stale review delegate running after it started a new one.Change
Three one-line text changes:
packages/contracts/src/orchestratorMcp.ts: the running-tasknextnow says "Completion wakes this thread, so end your turn. Do not wait on it or poll it."apps/server/src/mcp/toolkits/orchestrator/tools.ts: thetask_statusdescription says not to call it on a running task before its completion wakes you.packages/provider-core/src/server/orchestrationInstructions.ts: stop a delegate run you replace or no longer need withtask_cancel.Scope and approval
Maintainer work (Theo). Text only, no behavior change. It follows the instruction cuts in #24850.
Verification
Full MCP eval runs with this text (a case fails when half or more of its samples fail):
child-pr-not-linked: the child runs out of its 8 steps.node scripts/check-changed.tspasses.vp test run src/orchestration-v2/testkit src/mcpinapps/serverpasses (413 tests).Changes made with Claude Opus 5.5 in Claude Code (T3 Code).
🤖 Generated with Claude Code