OTel client span sets ERROR status for -32602 and other caller-error codes
維護者通常 1 天內回覆
還沒有人認領這個 Issue。
評估
- 難度
- 2/5
- 預估耗時
- 1-3 小時
- 新手友好度
- 76/100
- Issue 類型
- 缺陷
- 描述清晰度
- 描述清楚
- 活躍度
- 活躍
- 技術堆疊
- python
研究方向
先閱讀設定 client span 狀態和 error.type 的 dispatcher 程式碼,再將其行為與伺服器端分類以及 docs/gen-ai/mcp.md 中關於 MCP 語意慣例的說明進行比較。如果可行,請使用 issue 中的命令重現。完成條件是:列出的五個 caller-error 代碼仍會填入 rpc.response.status_code,但狀態維持為 Unset,並省略 error.type,且測試涵蓋此行為。
由索引模型根據 Issue 內容生成。
描述
Since 2.3.0 (#3174) every JSON-RPC error response marks the client span ERROR with error.type set to the code. The OTel GenAI semantic conventions for MCP (docs/gen-ai/mcp.md, footnote on error.type) say the codes -32700, -32600, -32601, -32602 and -32002 "indicate that the caller sent a request the receiver could not serve and SHOULD NOT be considered errors"; only other codes should be. rpc.response.status_code should still carry the code.
The most common case is calling an unknown tool: the Go SDK server (and the TypeScript SDK) answer -32602, and the Python client span becomes ERROR with error.type=-32602.
Reproduction (Python 2.3.0 client against a Go SDK server):
git clone https://github.com/mkwitko/mcp-reliability && cd mcp-reliability
examples/python-sdk-streamable-http/run.sh
go run ./cmd/mcp-reliability doctor testdata/cross-python-client-go-server.jsonl
[WARN] MCP-ERR-005: span "tools/call missing" is marked failed (status=Error, error.type present=true) for a JSON-RPC code the semconv says SHOULD NOT be considered an error
Write-up: https://github.com/mkwitko/mcp-reliability/blob/v0.1.0/docs/research/python-sdk-v2-validation.md
Suggested change: in the dispatcher, when the error code is one of the five caller-error codes, set rpc.response.status_code but leave the span status Unset and skip error.type. The server side already has the equivalent classification. I can send a PR.
- 主要語言
- Python
- 星號
- 24.7k
- 分支
- 4.1k
- 平均合併
- 18 小時 27 分鐘
- 30 天內合併 PR
- 15
環境準備
- 沒有 Dockerfile 或 Docker Compose 檔案
- 有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
modelcontextprotocol/python-sdk 的其他 Issue
-
bug v2
難度 2/5 1-3 小時 新手友好度 79/100
modelcontextprotocol/python-sdk#3810 ·
維護者通常 1 天內回覆
-
bug v1 v2
難度 2/5 1-3 小時 新手友好度 79/100
modelcontextprotocol/python-sdk#3781 · 2 則留言 ·
維護者通常 1 天內回覆
-
[Bug]: Inconsistent structured output wrapping and opt-out for typing.Dict and typing sequence generics in func_metadata可能重新可做 關聯的 PR 已關閉且未合併。 未關閉bug v1 v2
難度 2/5 1-3 小時 新手友好度 82/100
modelcontextprotocol/python-sdk#3771 · 3 則留言 ·
維護者通常 1 天內回覆
-
bug v2
難度 2/5 1-3 小時 新手友好度 68/100
modelcontextprotocol/python-sdk#3769 · 2 則留言 ·
維護者通常 1 天內回覆
-
2026 Streamable HTTP rejects whitespace-padded Mcp-Name values可能重新可做 關聯的 PR 已關閉且未合併。 未關閉bug spec-2026-07-28 v2
難度 2/5 1-3 小時 新手友好度 68/100
modelcontextprotocol/python-sdk#3763 · 4 則留言 ·
維護者通常 1 天內回覆
查看 modelcontextprotocol/python-sdk 的全部 Issue
相似的 Issue
-
Backend issue lists report in-patch warnings and out-of-patch errors as not publishable可能已有人在做 @RaphaelFakhri 今天認領。 未關閉
難度 2/5 1-3 小時 新手友好度 75/100
mozilla/code-review#3794 ·
維護者通常 1 天內回覆
-
[oblt-aw][autodoc] Update docs that still describe the security registry as empty可能已有人在做 @github-actions 今天認領。 未關閉
難度 1/5 1-3 小時 新手友好度 85/100
維護者通常 1 天內回覆
-
[Bug] adb backup script reports "Done" & exits 0 when the backup fails可能已有人在做 @bhattmanthan 今天認領。 未關閉request-issue-assignment
難度 2/5 1-3 小時 新手友好度 72/100
維護者通常 1 天內回覆
-
agent-ui bug p2
難度 2/5 1-3 小時 新手友好度 72/100
維護者通常 1 天內回覆
-
correction metadata
難度 1/5 1 小時以內 新手友好度 72/100
acl-org/acl-anthology#10768 · 1 則留言 ·
維護者通常 1 天內回覆