Span status contains tool result content and exception messages
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 67/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- csharp
调研方向
issue 指出,设置 span 状态描述的位置是 McpSessionHandler.AddResponseTags 和 AddExceptionTags。阅读这些方法以及 MCP 错误的 tracing 约定,然后检查与 span 状态描述相关的测试。完成标准是省略工具结果内容和非 McpProtocolException 消息,保留协议错误消息,并且测试覆盖这些情况。
由索引模型根据 Issue 内容生成。
描述
Describe the bug
When a tool returns isError, the server span's status description is set to the whole content array as JSON (McpSessionHandler.AddResponseTags). When a handler throws, it's set to e.Message (AddExceptionTags).
We run two MCP servers on 1.4.2 and found confirmation tokens and customer data from tool results in our tracing backend because of this. It's the same on main after 2.4.0.
To Reproduce
- Listen to the
Experimental.ModelContextProtocolactivity source on the server. - Call a tool that returns
isError: truewith some content, or one that throws. - Look at the server span's status description.
Expected behavior
No description for isError results, since error.type=tool_error already marks them, and none for exceptions that aren't an McpProtocolException. The conventions only ask for the JSONRPCError.message, and the result content has its own opt-in attribute.
Additional context
For now we clear the description in a span processor before export.
Happy to open a PR for this. If you agree with the direction.
- 主要语言
- C#
- 星标
- 4.7k
- 派生
- 863
- 平均合并
- 15 小时 29 分钟
- 30 天内合并 PR
- 8
环境准备
在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
modelcontextprotocol/csharp-sdk 的其他 Issue
-
bug
难度 2/5 1-3 小时 新手友好度 74/100
modelcontextprotocol/csharp-sdk#2061 ·
维护者通常 1 天内回复
-
Image/audio content in SamplingMessage and CreateMessageResult is base64-encoded twice可能已有人在做 @atailakh 于 8 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 68/100
modelcontextprotocol/csharp-sdk#2033 ·
维护者通常 1 天内回复
-
Docs: stateless.md says the stateful task store is "scoped per session", but Tasks are unavailable in strict Stateful mode可能已有人在做 @FOWEPJF255 于 7 天前认领。 未关闭
难度 1/5 1 小时以内 新手友好度 88/100
modelcontextprotocol/csharp-sdk#2031 ·
维护者通常 1 天内回复
-
Static resources whose URIs differ only in the fragment or user info collapse into one可能已有人在做 @halter73 于 18 天前认领。 未关闭P2
难度 2/5 1-3 小时 新手友好度 78/100
modelcontextprotocol/csharp-sdk#1970 · 4 条评论 · 已指派 1 人 ·
维护者通常 1 天内回复
-
POST /mcp with a missing or unparseable Content-Type returns HTTP 500 instead of a 4xx可能已有人在做 @halter73 于 18 天前认领。 未关闭bug
难度 2/5 1-3 小时 新手友好度 72/100
modelcontextprotocol/csharp-sdk#1966 · 5 条评论 · 已指派 1 人 ·
维护者通常 1 天内回复
查看 modelcontextprotocol/csharp-sdk 的全部 Issue
相似的 Issue
-
kronos:develop:queued priority:P0
难度 2/5 1-3 小时 新手友好度 76/100
-
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 65/100
nopSolutions/nopCommerce#8512 ·
维护者通常 4 天内回复
-
难度 2/5 1-3 小时 新手友好度 76/100
维护者通常 1 天内回复
-
bug effort:S P3
难度 2/5 1-3 小时 新手友好度 78/100
nightscout/nocturne#4767 ·
维护者通常 1 天内回复