csv_output silently overwrites distinct fields when flattened keys collide
维护者通常 2 天内回复
还没有人认领这个 Issue。
评估
调研方向
阅读 pkg/github/csv_output.go,尤其是 appendFlattenedCSVFields 和 csvColumnName,然后查看 pkg/github/csv_output_test.go 中的扁平化测试。添加报告中提到的 JSON 行,其中包含一个带字面点号的键及其对应的嵌套路径。完成标准是输出具有确定性并保留两个值,或者明确报告该行无法无损表示。
由索引模型根据 Issue 内容生成。
描述
Summary
When csv_output is enabled, list-tool results are converted to CSV by flattening nested objects with .-joined column names. A literal field name containing . can produce the same column name as a nested field. One value is silently overwritten; Go map iteration makes the surviving value unpredictable.
Reproduction (from the current implementation)
Convert a list response containing this JSON row through jsonTextToCSV:
[{"user.login":"literal","user":{"login":"nested"}}]
appendFlattenedCSVFields maps both the top-level user.login and the nested user → login to the same row["user.login"]. The resulting CSV has only one user.login column, containing either literal or nested, depending on map iteration order. The other value is lost.
The conversion is used by withCSVOutput for default list_* tools whenever the csv_output feature flag is enabled (including insiders mode). This is a code-path demonstration, not a claim of a live GitHub API response with these exact fields.
Expected behavior
Distinct JSON fields remain distinguishable in CSV, or the conversion explicitly reports that it cannot represent this row without loss. The chosen output should be deterministic.
Suggested fix
Escape/encode path components when building flattened column names, or detect collisions and use unambiguous names/fail clearly. Add a regression test with both a literal dotted key and an equivalent nested path (and verify neither value is silently dropped).
Source
pkg/github/csv_output.go:appendFlattenedCSVFields,csvColumnName,csvRowsFromArray, andwithCSVOutput.pkg/github/csv_output_test.go: existing flattening tests cover nested objects, but not colliding flattened names.
- 主要语言
- Go
- 星标
- 34.4k
- 派生
- 5.3k
- 平均合并
- 3 天 10 小时
- 30 天内合并 PR
- 11
环境准备
- 提供 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
github/github-mcp-server 的其他 Issue
-
update_issue_labels is annotated destructiveHint: false but replaces (removes) existing labels可能已有人在做 @shhhhhhjokerist 于 6 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 69/100
github/github-mcp-server#3760 · 1 条评论 ·
维护者通常 2 天内回复
-
docs(install-claude): "environment variable" examples put the PAT in argv and the saved config可能已有人在做 @shhhhhhjokerist 于 6 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 82/100
github/github-mcp-server#3758 ·
维护者通常 2 天内回复
-
难度 2/5 1-3 小时 新手友好度 69/100
github/github-mcp-server#3729 ·
维护者通常 2 天内回复
-
难度 2/5 1-3 小时 新手友好度 65/100
github/github-mcp-server#3722 ·
维护者通常 2 天内回复
-
Insiders Feedback: PR created UI doesn't link to the PR可能已有人在做 @genius-0963 于 12 天前认领。 未关闭bug insiders user-experience
难度 2/5 1-3 小时 新手友好度 65/100
github/github-mcp-server#3658 ·
维护者通常 2 天内回复
查看 github/github-mcp-server 的全部 Issue
相似的 Issue
-
kind/features
难度 2/5 1-3 小时 新手友好度 75/100
TencentBlueKing/bk-nodemgr#4017 ·
维护者通常 1 天内回复
-
ssa: wait errors drop the kstatus message, so health check failures don't say why可能已有人在做 @schdief 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 76/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 76/100
equinor/radix-operator#2066 ·
维护者通常 2 天内回复
-
难度 2/5 1-3 小时 新手友好度 67/100
microsoft/terraform-provider-msgraph#188 · 1 个 reaction ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 77/100
维护者通常 2 天内回复