Skip to content
Source
Sign inSign up
pingdotgg/t3code

[Bug]: Steering a GitHub Copilot thread kills its running background agents #26695

Closedianrowe12(GitHub profile, opens in a new tab) opened this issue 0 comments

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. Use GitHub Copilot through the ACP Registry provider (github-copilot-cli, Copilot CLI 1.0.105).
  2. Send: "Launch ONE background agent (task tool, mode background) that runs sleep 90; echo BG_DONE. Then run sleep 40 yourself in the foreground, then reply DONE."
  3. While the background agent's sleep 90 is running, send any follow-up with the default Steer follow-up behavior.

Protocol-level reproduction (outside T3, below) confirms the Copilot side. The T3 side follows from the code paths cited here; I didn't record it in a T3 client.

Expected behavior

The follow-up reaches Copilot and the background agent keeps running. The orchestrator already states this rule for selection changes: restarting a turn "would end the turn's native subagents, which a steer must never do" (apps/server/src/orchestration-v2/Orchestrator.ts:4502-4504, from #19210).

Actual behavior

The background agent and its shell command are cancelled.

ACP agents steer by interrupt and restart (supportsSteeringByInterruptRestart: true, packages/provider-acp/src/server/adapter.ts:484). T3 sends session/cancel, awaits the interrupted turn's terminal result (interruptAndAwaitTerminal, apps/server/src/orchestration-v2/EffectWorker.ts:328), then sends a new session/prompt. On Copilot, session/cancel is a full abort that also cancels background agents. Waiting for the terminal result doesn't help, because the background agent is already gone by then.

Copilot also keeps session/prompt open until its background agents finish and its automatic wake-up turn ends. So with the default Steer setting, an ordinary composer follow-up sent while a background agent runs takes this interrupt-and-restart path, even after the main agent has finished its reply.

Impact

Minor bug or occasional failure

Background work Copilot started is lost when the user sends a follow-up before it finishes. Queueing the follow-up instead of steering should avoid it, since a queued message waits for the turn to end, but I haven't tested that in T3.

Version or commit

upstream main 9826dbb990 (code paths above). Copilot CLI 1.0.105.

Environment

macOS (Apple silicon). Copilot CLI 1.0.105 over ACP (copilot --acp), model claude-haiku-4.5.

Logs or stack traces

A standalone ACP client drove copilot --acp with T3's steer order: session/cancel, wait for the first prompt's result, then a new session/prompt. Copilot's raw session events were subscribed via _meta["github.com/copilot"].events. Frames are summarized; t is seconds since spawn.

 8.225 in  subagent.started            background agent
10.781 in  tool.execution_start        background agent runs bash "sleep 90; echo BG_DONE"
13.893 out session/cancel
13.893 in  abort {reason:"user_initiated"}
13.898 in  subagent.completed {cancelled:true}
13.900 in  first session/prompt result {stopReason:"cancelled"}
13.902 out second session/prompt       (sent only after the result above)
14.492 in  second session/prompt result {stopReason:"end_turn"}

Copilot's debug log for the same run shows the background shell killed at the abort, with no exit code.

A plain follow-up session/prompt with no session/cancel, sent while the main agent was idle but the first prompt was still open, had the same effect:

 3.867 in  subagent.started            background agent
 4.498 in  assistant.idle              main agent finished; first prompt still pending
 6.691 in  tool.execution_start        background agent runs bash "sleep 90; echo BG_DONE"
 9.891 out second session/prompt       (no cancel)
 9.898 in  abort {reason:"user_initiated"}
 9.926 in  subagent.completed {cancelled:true}
10.502 in  first session/prompt result {stopReason:"cancelled"}

Each scenario ran once, on one model.

Additional context

Since Copilot aborts on any new prompt while background agents run, switching Steer to a plain prompt wouldn't help. Options for maintainers to choose from:

  • While a Copilot turn has live background agents, queue follow-ups until session/prompt resolves instead of steering.
  • Use a Copilot-specific delivery that doesn't abort background agents, if Copilot exposes one over ACP. Copilot's SDK documents separate experimental interruptMainTurn and cancelAllBackgroundAgents methods (source). I haven't verified whether either is reachable over ACP in CLI 1.0.105.

#17159 describes a related symptom for Grok background subagents.

Investigated by Opus 5.5 with Claude Code. Reviewed by GPT 6.1 Sol.

Sign in to join this conversation.