You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Let Codex and OpenCode threads wait on background commands (t3_background_wait beyond Claude)
#33333
I use the same agent rules across Claude, Codex and OpenCode threads. When an agent starts a long command in the background (a test suite, a build) and ends its turn to wait for it, I want the thread to stay in Working or Waiting until the command finishes. Right now it shows as done in the sidebar and goes back to the inbox while the command is still running.
What happens
Only Claude threads can stay in Waiting. A background command or monitor holds a thread only when the agent marks it as awaited (backgroundWorkHoldsCompletion), and the only way to mark it is t3_background_wait. The tool's description says "Claude only", and only the Claude adapter implements awaitBackgroundTasks, so for every other provider ThreadManagementService returns unsupported (L1445-L1450).
So while a background command runs:
Claude: Waiting if the agent calls t3_background_wait, Done if it doesn't.
Codex: always Done, with a "Running · " note. The adapter already tracks the command (runningCommandItemsByTurn) and starts a new turn when it finishes (CodexAdapterV2.ts#L5105-L5145), so the wake works. Only the status is wrong.
On Codex and OpenCode the only workaround I have is telling the agent to block in the foreground (flock, tail --pid) instead of backgrounding the command.
Proposal
Keep the opt-in policy as it is. Unmarked commands still wouldn't hold the thread, so dev servers and watchers behave exactly as they do now. Changing that default is what #27355 tried, and it was closed for it.
Instead, let more providers opt in:
Implement awaitBackgroundTasks in the Codex adapter, matching ids against the background commands it already tracks, and report those entries in pendingBackgroundTasks with awaited: true.
Offer t3_background_wait and its system prompt guidance to those providers, and change "Claude only" in the description to the providers that support it.
One thing I'm not sure about is which id the agent should pass. It has to be one the model sees in its tool output. For Codex that's probably the background terminal's process id, but I haven't checked what Codex shows the model.
#32502 did this for Hermes over ACP and was closed only because Hermes isn't registered in acpRegistry yet, so the adapter side of this has already been sketched once.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
What I'm trying to do
I use the same agent rules across Claude, Codex and OpenCode threads. When an agent starts a long command in the background (a test suite, a build) and ends its turn to wait for it, I want the thread to stay in Working or Waiting until the command finishes. Right now it shows as done in the sidebar and goes back to the inbox while the command is still running.
What happens
Only Claude threads can stay in Waiting. A background command or monitor holds a thread only when the agent marks it as awaited (
backgroundWorkHoldsCompletion), and the only way to mark it ist3_background_wait. The tool's description says "Claude only", and only the Claude adapter implementsawaitBackgroundTasks, so for every other providerThreadManagementServicereturnsunsupported(L1445-L1450).So while a background command runs:
t3_background_wait, Done if it doesn't.runningCommandItemsByTurn) and starts a new turn when it finishes (CodexAdapterV2.ts#L5105-L5145), so the wake works. Only the status is wrong.commandtask, so the thread would still show Done.On Codex and OpenCode the only workaround I have is telling the agent to block in the foreground (
flock,tail --pid) instead of backgrounding the command.Proposal
Keep the opt-in policy as it is. Unmarked commands still wouldn't hold the thread, so dev servers and watchers behave exactly as they do now. Changing that default is what #27355 tried, and it was closed for it.
Instead, let more providers opt in:
awaitBackgroundTasksin the Codex adapter, matching ids against the background commands it already tracks, and report those entries inpendingBackgroundTaskswithawaited: true.t3_background_waitand its system prompt guidance to those providers, and change "Claude only" in the description to the providers that support it.One thing I'm not sure about is which id the agent should pass. It has to be one the model sees in its tool output. For Codex that's probably the background terminal's process id, but I haven't checked what Codex shows the model.
#32502 did this for Hermes over ACP and was closed only because Hermes isn't registered in
acpRegistryyet, so the adapter side of this has already been sketched once.Related
t3_background_waitanswered for Claudet3_background_waitfor Hermes over ACPt3_background_waitsucceeds when none of its ids exist; worth fixing before more providers rely on itChecked against main at 4c8eb1d (2026-11-09).
All reactions