Skip to content

[Bug]: steer/restart on a finished delegate thread fails with an error that doesn't say how to continue it #31891

Closed

Description

@Guria

Before submitting

  • I searched existing issues and did not find a duplicate.
  • I included enough detail to reproduce or investigate the problem.

Area

apps/server

Steps to reproduce

  1. From a Claude parent thread, run a delegate_task and let the child finish.
  2. Call t3_thread_send on the child's thread id with mode: "steer" or mode: "restart".
  3. Call t3_thread_send with mode: "auto" and the child id written with literal colons, thread:delegated-task:command:mcp:..., where the stored id has the command id percent-encoded, thread:delegated-task:command%3Amcp%3A....

Expected behavior

The errors should tell the agent how to continue a finished child. The t3_thread_send description says a send to a finished child starts a fresh task, so the agent was one correct call away each time.

Actual behavior

  • Step 2 returns thread_not_sendable: Thread ... has no running turn that can be steered. (or restarted). It doesn't say the child finished, and it doesn't mention that mode: "auto" or "queue" would start a new task there.
  • Step 3 returns thread_not_found with no hint. threadNotFound in apps/server/src/mcp/threadAccess.ts already suggests the mcp:-prefixed id when an agent pastes a bare uuid. It doesn't try the encoded form of a delegated id. IdAllocator builds that id with joinId("thread", "delegated-task", commandId), which encodeURIComponents the command id.

I audited ~170 Claude Code sessions in T3 Code on one project (Oct 18 to Nov 6, 2026) and found 13 of these failures in 4 sessions:

  • restart on a finished child. The agent wanted to move the child to another provider and continue it.
  • steer on a finished child. The agent wanted to give the child a new base commit after it had finished.
  • auto with the unencoded id, which got thread_not_found.

The injected orchestration instructions say "Every new delegate review or re-check is a new delegate_task ..., never a t3_thread_send." Agents still reach for t3_thread_send when they want to keep a child's context. The tool description invites that by documenting sends to finished children. #28734 covers a related gap in that rule for interrupted children.

Suggested fix

  • When a steer or restart targets a thread with no active run, return a message that says the thread finished and that mode: "auto" starts a new task in it. Point to delegate_task instead if continuing a finished delegate isn't meant to be supported. Then the tool description should stop advertising it.
  • Accept the unencoded form of thread:delegated-task:<commandId> ids, or at least add a "Did you mean" hint in threadNotFound, the same way the bare-uuid case works. [Bug]: Subagent thread IDs are very long and nested, wastes tokens and increases mistakes #28101 tracks the length of these ids.

Impact

Minor bug or occasional failure

Version or commit

Code read at main @ 2756da4. The audited sessions' builds weren't recorded.

Environment

Linux, Claude Code provider for parent and children.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions