github / github/copilot-cli

OTel: post-reload resumed turn emits `invoke_agent` root without input messages

未关闭
#4,726 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

area:sessions
主要语言
Shell
星标
11.2k
派生
1.9k
平均合并
14 小时 16 分钟
30 天内合并 PR
6

描述

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.messages and gen_ai.output.messages on its invoke_agent root;
  • the post-reload continuation emitted gen_ai.output.messages, but no gen_ai.input.messages, on its new invoke_agent root;
  • 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
  1. 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
    }
    
  2. Start a Copilot CLI / Agent Host request that performs enough tool work to remain active.

  3. While the turn is still running, reload the VS Code window.

  4. Let Agent Host reconnect and continue the existing turn.

  5. Inspect the locally exported OTLP spans or the configured backend.

  6. Compare the invoke_agent root 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_agent root structurally, but currently checks captured input/output content only on child chat spans: 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.

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

从 nodejs/test/e2e/telemetry.e2e.test.ts 开始,跟踪 Agent Host telemetry 路径中活动轮次的 reload/reconnect 生命周期。启用内容捕获后重现 continuation 场景,然后添加覆盖,检查恢复的 invoke_agent root 是否包含 gen_ai.input.messages,并运行 telemetry E2E 测试。

由索引模型根据 Issue 内容生成。

评估

技术栈
nodejs
领域
observability-sre, testing-qa
Issue 类型
缺陷
难度
4/5
预计耗时
3-5 天
活跃度
活跃
描述清晰度
基本清楚
新手友好度
66/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。