Repository navigation
fix(mcp): t3_thread_wait no longer has parents poll a task's first run - #40633
Conversation
t3_thread_wait found the caller's task only through the run's delegatedTaskId, which only follow-up runs carry. During a delegated task's first run it never added the "end your turn" hint that task_status gives, so the parent was told to call again until the child finished. An untagged run now resolves to the task its thread was forked from, while that task has no result, as follow-up intake already treats it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
…xt case Replace the separate replay-harness case with assertions in the existing mocked test: an untagged first run gets the end-turn guidance, and an untagged run after the task has its result does not. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
EvidenceDelegate the exact
Both children completed after 120 seconds and woke their parents into ordinal 2. ACP driver · Reproduction setup Not shown:
|
**v0.1.12-nightly.20261122.5085** · 20 changes from 10 contributors - **Reliable image sends.** Messages now wait for images to finish uploading before sending. - **Rich text pasting.** Paste text from Microsoft Word and other rich text apps into the composer instead of attaching an image. - **Provider refresh.** Refresh providers to find newly installed Claude or Codex without restarting the server on macOS and Linux. - **Scheduled task drafts.** Clicking outside the scheduled task editor no longer discards your draft. ### Plus 16 more bug fixes and performance improvements. <details> <summary>Full changelog</summary> ## What's Changed * perf(shared): Windows command lookups reuse PATH listings across requests by @juliusmarminge in pingdotgg/t3code#40634 * fix(mcp): t3_thread_wait no longer has parents poll a task's first run by @navidnadali in pingdotgg/t3code#40633 * fix(server): reveal no longer opens Explorer's default folder for a missing file by @juliusmarminge in pingdotgg/t3code#40637 * fix(server): a steer that missed its turn keeps its place in the queue by @navidnadali in pingdotgg/t3code#40622 * fix(web): wrapped prompt suggestion no longer overlaps the composer toolbar by @juliusmarminge in pingdotgg/t3code#40654 * fix(server): refuse ref switches while a thread works in the shared checkout by @gbrasil720 in pingdotgg/t3code#38271 * fix(server): label speaker notes in OpenDocument attachments by @geezoria in pingdotgg/t3code#38542 * fix(server): folder discovery skips the walk when t3.json ignores the whole project by @juliusmarminge in pingdotgg/t3code#40664 * fix(server): checkpoint repository scopes walk the project folder once per turn by @Sidreyas in pingdotgg/t3code#40671 * fix(server,cursor): preserve inline handoff when a failed Cursor turn drops its prompt by @MIT-Consulting in pingdotgg/t3code#40670 * perf(web): Markdown renders with Words as static islands under one shared tooltip; remark leaves the web app by @juliusmarminge in pingdotgg/t3code#27866 * fix(web): pasting text copied from Word inserts the text instead of an image by @juliusmarminge in pingdotgg/t3code#40686 * fix(web): wait for image uploads before sending by @Yash-Singh1 in pingdotgg/t3code#40672 * fix(server): provider refresh finds CLIs installed after launch on macOS and Linux by @juliusmarminge in pingdotgg/t3code#40693 * fix(mobile): replace undefined text-foreground-subtle token with text-foreground-muted by @MIT-Consulting in pingdotgg/t3code#40676 * fix(antigravity): a long shell command keeps its start, not its last 8,000 characters by @juliusmarminge in pingdotgg/t3code#40702 * fix(server): setup script output no longer ends in half an emoji by @tiliakoos in pingdotgg/t3code#40701 * fix(server): text generation no longer falls back to a model that cannot generate text by @tiliakoos in pingdotgg/t3code#40699 * fix(client-runtime): typing a bare Windows drive lists its folders by @brunobola in pingdotgg/t3code#40682 * fix(web): a click outside the scheduled task editor no longer discards the draft by @Jardo-51 in pingdotgg/t3code#40708 ## New Contributors * @gbrasil720 made their first contribution in pingdotgg/t3code#38271 * @MIT-Consulting made their first contribution in pingdotgg/t3code#40670 * @brunobola made their first contribution in pingdotgg/t3code#40682 **Full Changelog**: pingdotgg/t3code@v0.1.12-nightly.20261122.5071...v0.1.12-nightly.20261122.5085 </details> Upstream release: https://github.com/pingdotgg/t3code/releases/tag/v0.1.12-nightly.20261122.5085
Note
Written by Claude Opus 5.5 on behalf of Navid
Problem
When
t3_thread_waittimes out on a running run of the caller's own delegated task, it addsnext("Completion wakesthis thread. ... end your turn when none is left."), as
task_statusdoes. It finds that task through the run'sdelegatedTaskId, but only follow-up runs carry one. The run a delegated task starts with (delegated_task.requestdispatches its first message as a plain
message.dispatch) has none, so a wait during a task's first run never getsnext. The tool says "On timeout, withnextend your turn; without, call again", so a parent that waits on its childis told to keep calling until the child finishes, the polling #24782 meant to stop.
task_statusfor the same runningtask returns
next.Steps on main: call
delegate_task(async), thent3_thread_waiton itschildThreadIdwhile the child works. Eachcall returns
status: "running",timedOut: trueand nonext.Change
t3_thread_waitresolves a run without a task id to the task its thread was forked from, as the orchestrator alreadydoes for such runs, while that task has no result. A follow-up run still resolves through its own
delegatedTaskId.Scope
A small fix for an obvious bug (
t3_thread_waitandtask_statusdisagree about the same running task, and #24782'shint never fires for a task's first run), so no issue. #40604 (merged) changed a different check in the
same function; this change does not depend on it.
Verification
vp test run src/mcp/OrchestratorMcpService.test.ts -t "t3_thread_wait tells the parent to end its turn while a task's first run works"fromapps/server. The new case runs the real orchestrator: a parent turn delegates a task throughdelegated_task.request, the child's turn starts, and the parent'st3_thread_waiton the child times out. Onmainit fails by assertion (
expected undefined to equal 'Completion wakes this thread. ...'); with the change the filepasses (98 tests).
Runtime transcript: the real orchestrator, projection store (in-memory SQLite),
ThreadManagementServiceandOrchestratorMcpServicewith a scripted provider. A parent delegates a task and later sends the finished child afollow-up with
t3_thread_send. At each step it callstask_statusandt3_thread_wait(which times out while thechild works) on the child:
task_statusgivesnext(main / PR)t3_thread_waitgivesnext(main / PR)completed)macOS arm64, Node 26.13.1; the same on Linux x86_64 and Linux arm64 (Debian 13, Node 26.13.1).
To reproduce from checkouts of
mainand this PR with dependencies installed, runbash run.sh main=<main checkout> fix=<PR checkout>from https://gist.github.com/navidnadali/97409090fd84536674b0b1c324741c82 (it copies the transcript test into eachcheckout, runs it and removes it).
Also:
vp run check:changedpasses, andvp test run integrationfromapps/serverpasses (417tests). The new case passed 20 of 20 runs on Linux x86_64 and Linux arm64 (four at a time) and on macOS (one at a time).
Not checked: a live provider run (the transcript scripts the provider; the server path is the real one).
Made with Claude Opus 5.5 via Claude Code. Reviewed by GPT-6.1 Sol via Codex.
🤖 Generated with Claude Code