Skip to content

[Bug]: t3_background_wait error and Claude instructions don't say Workflow tasks already hold the thread #42655

Done

Description

@andrewfree

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. In a Claude thread, have the agent start a Claude Code Workflow (the Workflow tool runs in the background and returns a task ID such as wg53xzo6q).
  2. Before ending its turn, the agent follows the "Background work you wait on" instruction and calls t3_background_wait with the workflow's task ID.

Expected behavior

The agent should not need the call: a running workflow is a subagent item, and backgroundWorkHoldsCompletion already holds the thread in Working for subagents. If an agent does pass a workflow ID, the error should say that workflows already hold the thread, as it does for subagents, Agent tool and delegate_task IDs.

Actual behavior

The call fails with invalid_request (text below). Neither that message nor CLAUDE_BACKGROUND_WAIT_INSTRUCTIONS names Workflow, so the agent concluded that workflows "can't be registered" with the wait tool and told the user so as if it were a gap.

T3 behaved correctly throughout: the workflow's item (task:wg53xzo6q:subagent, type subagent, status running) kept run 1 running across the agent's turn end, pendingBackgroundTasks stayed empty, and the agent was woken when the workflow finished. Only the agent's explanation was wrong.

Impact

Cosmetic issue

Version or commit

0.1.12-nightly.20261125.5222 (source read at main c5d6aa1)

Environment

macOS 27.3 (arm64), T3 Code desktop nightly, Claude Code 2.1.331, Claude Opus 5.5 (claude-opus-5-5) on a claudeAgent-driver provider instance

Logs or stack traces

t3_background_wait {"taskIds":["wg53xzo6q"],"waiting":true}
-> invalid_request: None of these IDs is running background work on this thread, so this request registers no wait for them. If the task already finished, read its output now. Otherwise pass the task ID of a background command or Monitor you started. Subagent, Agent tool, and delegate_task IDs don't go here.

Screenshots, recordings, or supporting files

No response

Workaround

None needed. Workflows already hold the thread.

A possible fix is one word in the unmatched message in ThreadManagementService.ts: "Subagent, Agent tool, Workflow, and delegate_task IDs don't go here; they keep the thread working on their own." I have not added an eval case, because the agent took no wrong action (it did not poll, sleep or schedule a wakeup), so there is no failing behavior for a case to reproduce. Related: #29772 and #29773, which fixed the harmful version of this for subagent IDs.

Investigated and written by Claude Opus 5.5 (claude-opus-5-5) in Claude Code, run from T3 Code.

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