[Bug]: Delegated tasks have no time limit: a hung tool call keeps a child running for hours
Before submitting
- [x] I searched existing issues and did not find a duplicate. Related but different: #24842 (Claude phases stuck), #35274 (Grok thread running forever after handoff), #39093 (children keep running after the parent run fails).
- [x] I included enough detail to reproduce or investigate the problem.
Area
apps/server (delegated-task lifecycle)
Steps to reproduce
- In a Claude parent thread, call
delegate_taskfor a Pi child (Full access, modeasync). The parent ends its turn. - In the child, one tool call does not return. In our run, a Pi
editcall on a local Markdown file started and never produced a result. Its timeline item stayedfile_change/running. - Wait.
Expected behavior
A delegated task has a server-side upper time limit (configurable, for example per task or per environment). When the limit is reached, T3 interrupts the child run the same way the Stop button does, keeps the result that exists, and wakes the parent with a terminal status such as timed_out.
Actual behavior
The child run stayed running for 3 h 17 min, until a human pressed Stop. Nothing on the server side ends it:
delegate_taskhas no time limit parameter (timeoutMsapplies only to the parent's wait in modewait).- In-agent limits do not help when a tool call hangs. Our Pi extension called
ctx.abort()at its 45-minute budget. The hungeditcall did not end. A steer message queued at 40 minutes was never read ("Stop cleared 1 queued message Pi had not read"). - A harder in-agent stop is not safe for Pi, because Pi runs inside the T3 server process.
process.exit()stops the whole app. - The parent can only
task_cancelwhen it is running and remembers to. Here, the parent had read the child's output file directly and ended its turn, so the task stayed open.
The Stop button ended the hung run in about 3 seconds ("Stopped by user", run status interrupted). So the server can stop such a run. It only lacks a trigger.
Timeline (UTC, 2026-11-25):
- 15:47:27 child run starts
- 16:02:46 last assistant message
- 16:05:05
edittool call starts, never completes - 16:32:27 in-agent 45-minute budget:
abort()has no effect - 19:04:16 user presses Stop, run interrupted at 19:04:19
Impact
Major degradation or frequent failure
Version or commit
T3 Code (Beta) desktop 0.1.10
Environment
macOS 26.6.2, Apple Silicon. Parent: Claude (claude-opus-5-5). Child: Pi (openai-codex/gpt-6.1-sol).
Logs or stack traces
Child timeline tail (from t3_thread_read view=activity):
position 200 file_change status=running title=edit updatedAt=2026-11-25T16:05:05.710Z
position 201 run_interrupt_request "Stopped by user" 2026-11-25T19:04:16.893Z
position 202 system_notice "Stop cleared 1 queued message Pi had not read: AGENT: pstack-t3: 5 minutes remain of the 45-minute task budget. ..."
position 203 run_interrupt_result status=interrupted 2026-11-25T19:04:19.943Z
Thanks for writing this up. It asks for new behaviour rather than reporting a defect, so it does not belong in the bug tracker and I'm closing it as not planned here. Feature ideas are discussed in Discussions: please post it there.