t3code icon indicating copy to clipboard operation
t3code copied to clipboard

[Bug]: Delegated tasks have no time limit: a hung tool call keeps a child running for hours

Open electro56435 opened this issue 6 days ago • 1 comments

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

  1. In a Claude parent thread, call delegate_task for a Pi child (Full access, mode async). The parent ends its turn.
  2. In the child, one tool call does not return. In our run, a Pi edit call on a local Markdown file started and never produced a result. Its timeline item stayed file_change / running.
  3. 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_task has no time limit parameter (timeoutMs applies only to the parent's wait in mode wait).
  • In-agent limits do not help when a tool call hangs. Our Pi extension called ctx.abort() at its 45-minute budget. The hung edit call 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_cancel when 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 edit tool 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

electro56435 avatar Nov 26 '26 00:11 electro56435

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.

juliusmarminge avatar Nov 26 '26 00:11 juliusmarminge