OTel client span sets ERROR status for -32602 and other caller-error codes
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 76/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- python
调研方向
首先阅读设置客户端 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 条评论 ·
维护者通常 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
-
needs-area-label
难度 2/5 1-3 小时 新手友好度 66/100
维护者通常 2 天内回复
-
enhancement good first issue
难度 2/5 1-3 小时 新手友好度 84/100
Official-Space-AI/OpenPhysGraspGen#114 ·
维护者通常 2 天内回复
-
changelog investigate
难度 2/5 1-3 小时 新手友好度 62/100
ramnes/notion-sdk-py#441 ·
-
qa_bug
难度 2/5 1-3 小时 新手友好度 78/100
NVIDIA-NeMo/Gym#5644 ·
维护者通常 2 天内回复
-
BUG: catalog database credentials printed to logs at startup可能已有人在做 @cjboyle 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 70/100
维护者通常 1 天内回复