github / github/copilot-cli

SIGINT exits prompt process but model work continues and OTel later reports success

Đang mở
#4,863 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

triage
Ngôn ngữ chính
Shell
Star
11.2k
Fork
1.9k
Merge trung bình
14 giờ 16 phút
Pull request đã merge (30 ngày)
6

Mô tả

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
  1. Enable the OTel file exporter and force content capture off.
  2. Run copilot --prompt ... --stream on --model <available-model> --output-format json with a synthetic prompt that produces a long response; redirect output to a file.
  3. Wait for model.call_start and send SIGINT before the first assistant.message_delta.
  4. 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_finished or assistant.turn_end record.
  • OTel nevertheless contained a completed chat span and root invoke_agent span with status code 0, finish reason stop, 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.

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Hướng nghiên cứu

Theo dõi luồng không tương tác với --prompt từ xử lý SIGINT, qua công việc suy luận của tiến trình con/native, đến OTel file exporter. Tái hiện kịch bản tín hiệu xuất hiện trước delta đầu tiên, sau đó xác minh rằng việc hủy sẽ dừng công việc của các tiến trình hậu duệ, các span đang hoạt động kết thúc với kết quả bị hủy hoặc lỗi, các exporter flush trong một timeout có giới hạn, và không còn output writer nào sau khi kết thúc.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
shell
Lĩnh vực
cli, observability-sre
Loại issue
Lỗi
Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức độ hoạt động
Sôi nổi
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
45/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.