SIGINT exits prompt process but model work continues and OTel later reports success
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- Shell
- Sterne
- 11.2k
- Forks
- 1.9k
- Ø Merge
- 14 Std. 16 Min.
- Gemergte PRs (30 T.)
- 6
Beschreibung
Describe the bug
Interrupting an active non-interactive model call with SIGINT exits the foreground Copilot process, but a descendant/native worker continues producing output and completing the model call. The OTel file appears much later and records the interrupted operation as a successful completion rather than cancelled.
This means cancellation is not promptly propagated to the underlying work and can continue consuming model resources after the foreground process has exited.
Affected version
GitHub Copilot CLI 1.0.83 on macOS.
Steps to reproduce
- Enable the OTel file exporter and force content capture off.
- Run
copilot --prompt ... --stream on --model <available-model> --output-format jsonwith a synthetic prompt that produces a long response; redirect output to a file. - Wait for
model.call_startand send SIGINT before the firstassistant.message_delta. - Record foreground process exit, then continue observing the output and telemetry paths.
Observed result
- SIGINT was sent with zero response deltas observed.
- The foreground process returned as terminated by SIGINT.
- Approximately 55 seconds after the foreground process had exited, inherited output continued to grow and the telemetry file appeared.
- Output contained partial response deltas but no
model.call_finishedorassistant.turn_endrecord. - OTel nevertheless contained a completed
chatspan and rootinvoke_agentspan with status code 0, finish reasonstop, response model, and full token usage. No cancellation/error attribute was present.
A prior late-stream attempt showed the same delayed-file behavior but was not suitable for proving when cancellation was sent. The reproduction above signals immediately after model.call_start.
Expected behavior
On the first termination signal, Copilot should propagate cancellation to child/native inference work, end active spans with a cancelled/error outcome, force-flush and shut down exporters with a bounded timeout, and then preserve the conventional signal exit result. No model work or output writer should remain active after the foreground command reports termination.
A downstream Collector cannot correct a successful producer span or cancel orphaned producer work.
Privacy
The reproduction used only synthetic content and OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT=false. No credentials or user data are included.
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Verfolge den nicht-interaktiven Pfad mit --prompt von der SIGINT-Behandlung über die Inferenzarbeit von Child/Native bis zum OTel-Datei-Exporter. Reproduziere das Szenario eines Signals vor dem ersten Delta und überprüfe anschließend, dass die Abbruchanforderung die Arbeit der Nachfahren beendet, aktive Spans mit einem abgebrochenen oder fehlerhaften Ergebnis abgeschlossen werden, Exporter innerhalb eines begrenzten Timeouts flushen und nach der Beendigung kein Output-Writer zurückbleibt.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- shell
- Bereich
- cli, observability-sre
- Issue-Typ
- Bug
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Aktivitätsstatus
- Aktiv
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 45/100