OTel: post-reload resumed turn emits `invoke_agent` root without input messages
Chưa có ai nhận issue này.
- 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
When a running Copilot CLI turn in VS Code Agent Host is interrupted by a VS Code window reload and then continues after Agent Host reconnects, the new root invoke_agent span can omit gen_ai.input.messages even though message-content capture is enabled.
This is specific to the resumed/continued invocation path, not every turn:
- the ordinary user turn immediately before the reload emitted both
gen_ai.input.messagesandgen_ai.output.messageson itsinvoke_agentroot; - the post-reload continuation emitted
gen_ai.output.messages, but nogen_ai.input.messages, on its newinvoke_agentroot; - ordinary user turns immediately afterward again emitted both input and output.
The exporter was healthy and child chat/tool spans were present. Some later child model spans contained input content, so this was not a transport failure or a global content-capture setting problem.
In LangSmith, gen_ai.input.messages is mapped to the run input. The affected root therefore appears as No data in the trace/Turns UI even though the continued turn did useful work and produced child spans.
Affected version
Observed on 1.0.81-0 (the value recorded in both the root span's service.version and gen_ai.agent.version attributes).
The latest CLI installed locally is now 1.0.82, but I have not yet repeated the active-turn reload sequence on that version, so I cannot claim that version is affected.
Steps to reproduce the behavior
-
In VS Code, enable Agent Host OTel export and content capture:
{ "chat.agentHost.otel.enabled": true, "chat.agentHost.otel.exporterType": "otlp-http", "chat.agentHost.otel.captureContent": true, "chat.agentHost.otel.dbSpanExporter.enabled": true } -
Start a Copilot CLI / Agent Host request that performs enough tool work to remain active.
-
While the turn is still running, reload the VS Code window.
-
Let Agent Host reconnect and continue the existing turn.
-
Inspect the locally exported OTLP spans or the configured backend.
-
Compare the
invoke_agentroot created for the post-reload continuation with ordinary roots before and after it.
Observed result: the continuation root has output and child spans but no gen_ai.input.messages attribute.
Expected behavior
With content capture enabled, an invoke_agent root that continues a user-initiated turn after reconnect/reload should remain self-contained and include the originating user input in gen_ai.input.messages.
If a reconnect intentionally starts a separate continuation trace, it should still carry meaningful continuation input/context (and ideally an explicit link to the original invocation) so OTel backends do not display an input-less root.
Additional context
- VS Code:
1.136.1 - OS: macOS
- Integration: VS Code Agent Host using the Copilot SDK/runtime
- Export: OTLP/HTTP to LangSmith plus the Agent Host local SQLite span exporter
- No OTLP forwarding failures were present after reload.
- The affected root began immediately after the fresh Agent Host process started, before the next user message. Its predecessor ended just before reload, and the next ordinary user-message root had input normally. This is why the evidence points to the reload/resume lifecycle path rather than an intermittent exporter failure.
- The public SDK telemetry E2E test validates the
invoke_agentroot structurally, but currently checks captured input/output content only on childchatspans: https://github.com/github/copilot-sdk/blob/main/nodejs/test/e2e/telemetry.e2e.test.ts
A regression test that reloads/reconnects during an active turn and asserts root-level gen_ai.input.messages would cover this path without relying on a particular OTel backend.
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Hướng nghiên cứu
Bắt đầu với nodejs/test/e2e/telemetry.e2e.test.ts và lần theo vòng đời reload/reconnect của lượt đang hoạt động trong đường dẫn telemetry của Agent Host. Tái hiện kịch bản tiếp tục với tính năng thu thập nội dung được bật, sau đó bổ sung coverage để kiểm tra root invoke_agent được tiếp tục có chứa gen_ai.input.messages và chạy bài kiểm thử E2E telemetry.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- nodejs
- Lĩnh vực
- observability-sre, testing-qa
- 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
- 66/100