v2: Tool.execute and MCP.callTool spans no longer carry tool.name / tool.call_id
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 76/100
- Issue 类型
- 功能
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- typescript
调研方向
从 packages/core/src/tool.ts 和 packages/core/src/mcp/index.ts 开始,issue 指出 span 在这里创建;然后检查 #22531 和 #25452 中 v1 属性的记录方式。要添加的值已经在作用域内,hook tool.execute.after 也会收到这些值。完成标准是:tool 和 MCP span 在 OTLP trace 中公开所请求的 tool、调用、会话、操作和服务器属性。
由索引模型根据 Issue 内容生成。
描述
Description
In v2, the Tool.execute and MCP.callTool spans no longer say which tool ran. In v1 they had tool.name and tool.call_id (#22531, and #25452 for MCP and plugin tools). Since the v2 rewrite, Tool.execute in packages/core/src/tool.ts is a bare Effect.fn("Tool.execute"), and MCP.callTool in packages/core/src/mcp/index.ts has no attributes either.
In a trace backend, every tool call now looks the same: status and duration only. The only way to tell which tool a span ran is the error message, and only when the call fails (MCP tool "github-get_file_contents" on server "litellm" failed: …).
Expected: the attributes from v1, ideally also with the OTel GenAI names, so GenAI-aware backends can show the calls:
tool.name/gen_ai.tool.nametool.call_id/gen_ai.tool.call.idgen_ai.operation.name = execute_toolsession.id- for MCP: the server name, e.g.
mcp.server.name
The values are already in scope there (name, context.id, context.sessionID, input.server). The tool.execute.after hook receives them too.
Related: #46856 (trace context on MCP calls). Together these two would let MCP calls show up properly inside the agent trace.
Plugins
none
OpenCode version
2.1.2 (checked the code on v2.2.5)
Steps to reproduce
- Set
OTEL_EXPORTER_OTLP_ENDPOINTand runopencode runwith a prompt that uses a few tools (built-in and MCP). - Open the trace in any OTLP backend.
Tool.execute/MCP.callToolspans have notool.nameor call id. On v1 they did.
Operating System
Linux (container)
Terminal
n/a (opencode run)
- 主要语言
- TypeScript
- 星标
- 224k
- 派生
- 30k
- 平均合并
- 5 小时 25 分钟
- 30 天内合并 PR
- 494
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
anomalyco/opencode 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 76/100
anomalyco/opencode#62322 · 1 条评论 ·
维护者通常 1 天内回复
-
docs: AgentEditor.update creates missing agents, but the plugin docs don't say so可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭
难度 1/5 1 小时以内 新手友好度 76/100
anomalyco/opencode#62210 · 1 条评论 ·
维护者通常 1 天内回复
-
tui: /models drops provider grouping when the session location differs from the default location可能重新可做 关联的 PR 已关闭且未合并。 未关闭reproduced
难度 2/5 1-3 小时 新手友好度 65/100
anomalyco/opencode#62105 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 65/100
anomalyco/opencode#62046 · 4 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 68/100
anomalyco/opencode#61897 · 1 条评论 ·
维护者通常 1 天内回复
查看 anomalyco/opencode 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
binding:python bug
难度 2/5 1-3 小时 新手友好度 82/100
维护者通常 1 天内回复
-
enhancement
难度 2/5 1-3 小时 新手友好度 78/100
coollabsio/orbit#72 ·
维护者通常 1 天内回复
-
Bug
难度 2/5 1-3 小时 新手友好度 67/100
维护者通常 1 天内回复
-
bug needs-triage potential-regression
难度 2/5 1-3 小时 新手友好度 78/100
aws/aws-sdk-js-v3#8408 ·
维护者通常 1 天内回复