OTEL `chat` spans do not have the proper parent span for subagents
未关闭
还没有人认领这个 Issue。
triage
- 主要语言
- Shell
- 星标
- 11.2k
- 派生
- 1.9k
- 平均合并
- 14 小时 16 分钟
- 30 天内合并 PR
- 6
描述
Describe the bug
When OTEL is enabled and copilot uses the task tool to start a subagent, an invoke_agent span is created which contains all the execute_tool spans, but a single chat span at the very beginning. All other chat spans do not have the appropriate parent set to the invoke_agent span.
This is especially confusing when copilot starts multiple subagents, because then the chat spans are all mixed together, and the github.copilot.turn_id do not make sense.
Affected version
No response
Steps to reproduce the behavior
- Enable OTEL
- Ask copilot to use the task tool multiple times, e.g. "Using the task tool, ask three sub-agents to summarize the last five commits of this project, then compare their summaries."
- Inspect the OTEL trace
Expected behavior
No response
Additional context
No response
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
启用 OTEL,使用多个 task-tool 子代理重现该 trace,然后检查生成的 invoke_agent、execute_tool 和 chat span。跟踪 span 的父级关系路径,并验证每个 chat span 都归组到相应的 invoke_agent span 下,同时 github.copilot.turn_id 值不再在子代理之间混杂。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- shell
- 领域
- observability
- Issue 类型
- 缺陷
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 活跃度
- 活跃
- 描述清晰度
- 基本清楚
- 新手友好度
- 55/100