Skip to content

feat(server): background commands can hold their thread in Working by default - #5

Open
omar7550 wants to merge 1 commit into
mainfrom
feat/background-commands-hold
Open

omar7550 wants to merge 1 commit into
mainfrom
feat/background-commands-hold

Conversation

@omar7550

Copy link
Copy Markdown
Owner

Problem

A thread whose agent waits on a background command (a deploy, a CI wait) left the sidebar's Working section as soon as its turn ended. Its footer still read "Waiting on 1 command", but the command only held the thread when the agent had called t3_background_wait. Agents often skip that call, so with 10 to 15 threads running, waiting threads mixed into the finished list.

Upstream deliberately does not hold unmarked commands, because a dev server or watcher looks the same (pingdotgg#27355 was closed for that reason). So this is an opt-in local patch, not an upstream proposal.

Change

With T3CODE_BACKGROUND_COMMANDS_HOLD=1 in the server's environment, the Claude adapter publishes every background command as awaited unless the agent released it with t3_background_wait waiting: false. The clients' existing rule then keeps the thread in Working as Waiting until the command ends. This needs no client change, so the desktop and phone apps both pick it up from the server. Monitors and subagents keep their current behaviour. Without the variable nothing changes.

Verification

  • New test holds background commands by default when T3CODE_BACKGROUND_COMMANDS_HOLD is on: two unmarked local_bash tasks are published as awaited, and releasing one with waiting: false publishes it unawaited.
  • All 384 background-related tests in ClaudeAdapterV2.test.ts pass, and server typecheck, lint, fmt and knip are clean.
  • Runs on agentbox as part of the local/nightly-patched stack.

Supersedes #2, the client-side version of this fix.

Written with Claude Code (Claude Opus 5.5).

🤖 Generated with Claude Code

@github-actions github-actions Bot added the vouch:trusted Author is trusted by repo permissions or the VOUCHED list. label Nov 17, 2026
… default

With T3CODE_BACKGROUND_COMMANDS_HOLD=1, a Claude background command counts
as awaited unless the agent releases it with t3_background_wait
waiting:false (a dev server, a watcher). A thread whose agent waits on a
deploy or CI command then stays in Working as Waiting, matching its
"Waiting on 1 command" footer, even when the agent never marked it. Off by
default; upstream behaviour is unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@omar7550
omar7550 force-pushed the feat/background-commands-hold branch from c40b205 to 7db8c75 Compare November 17, 2026 16:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M vouch:trusted Author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant