github / github/copilot-cli

write_agent  may block until the target background agent starts actively processing, causing new user input to queue

Offen
#4,101 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
area:agents
Vorherrschende Sprache
Shell
Sterne
11.2k
Forks
1.9k
Ø Merge
14 Std. 16 Min.
Gemergte PRs (30 T.)
6

Beschreibung

### Describe the bug

When calling  write_agent  to send a message to an idle background agent, the tool call appears to not return control back to the assistant's turn until the target agent has actually woken up and started actively running (processing the new message). If the user sends a new message during this window, it gets queued instead of being handled immediately — even though, from the assistant's perspective, only a single lightweight tool call was made.

Observed pattern (2 occurrences in one session):

1. Assistant calls  write_agent  targeting an idle background agent (e.g., asking it to start a new sub-task).
2. Assistant's turn appears to hang / user's next message gets queued for an extended period (not just a few seconds).
3. User presses Ctrl+C to interrupt and regain control.
4. Side effect: the background agent that had just been "woken up" by the  write_agent  call is found to be in a  Cancelled  state afterward (confirmed via  list_agents ), even though the user did not intend to cancel that specific agent — it seems the Ctrl+C interrupt, aimed at escaping the queue, also tore down whatever background agent had just transitioned into "actively running."

This happened twice with two different background agents in the same session (both times right after a  write_agent  call woke an idle agent into active work).

Expected behavior:
 write_agent  (and any similar "dispatch to background agent" tool) should return control to the assistant's current turn immediately after the message is enqueued/delivered, without waiting for the target agent to actually begin processing — so the assistant's turn can end promptly and the user's own next input is never blocked/queued behind a background agent's execution.

Environment:

• GitHub Copilot CLI version: 1.0.70
• Platform: Linux

Additional note: This is a hypothesis based on observed correlation (not confirmed via internal logs/source), but the pattern was consistent across two independent incidents in the same session.

### Affected version

_No response_

### Steps to reproduce the behavior

_No response_

### Expected behavior

_No response_

### Additional context

_No response_

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

Beginne damit, den write_agent-Dispatch der CLI und die Art und Weise nachzuverfolgen, wie list_agents den Zustand des Targets meldet; das Issue enthält keine Quelldateien oder Reproduktionsschritte. Untersuche, ob die Steuerung wartet, bis die Verarbeitung beginnt, und wie Ctrl+C weitergegeben wird; überprüfe anschließend, dass der Dispatch nach der Zustellung zurückkehrt, ohne den Agent im Hintergrund abzubrechen.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
shell
Bereich
cli
Issue-Typ
Bug
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Ruhig
Klarheit
Muss geklärt werden
Anfängerfreundlichkeit
38/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.