v2: Tool.execute and MCP.callTool spans no longer carry tool.name / tool.call_id
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 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 が、要求された tool、call、session、operation、server の属性を OTLP トレースで公開することです。
索引モデルが 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分
- マージ済み PR(30日)
- 494
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- 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対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープン
難易度 1/5 1時間未満 初心者へのやさしさ 76/100
anomalyco/opencode#62210 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
tui: /models drops provider grouping when the session location differs from the default location再び着手できるかも このイシューのプルリクエストはマージされずにクローズされました。 オープン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
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
難易度 1/5 1時間未満 初心者へのやさしさ 83/100
lingdojo/kana-dojo#33701 · コメント 1 件 · リアクション 5 件 ·
メンテナーはふだん 1 日以内に返信
-
tech-debt
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
rookslog/zlibrary-mcp#408 ·
メンテナーはふだん 1 日以内に返信
-
mp4box.js — 20-byte `sgpd` box with large `entry_count` causes unbounded loop and heap OOM abortオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 77/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
status: needs triage
難易度 2/5 1〜3時間 初心者へのやさしさ 64/100
mastra-ai/mastra#29641 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信