csv_output silently overwrites distinct fields when flattened keys collide
Maintainers usually reply within 2 days
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 84/100
Research direction
Read pkg/github/csv_output.go, especially appendFlattenedCSVFields and csvColumnName, then review the flattening tests in pkg/github/csv_output_test.go. Add the reported JSON row with a literal dotted key and its equivalent nested path. Done means the output is deterministic and preserves both values, or clearly reports that the row cannot be represented without loss.
Written by the indexing model from the issue text.
Description
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.
- Dominant language
- Go
- Stars
- 34.4k
- Forks
- 5.3k
- Avg merge
- 3d 10h
- Merged PRs (30d)
- 11
Getting set up
- Ships a Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from github/github-mcp-server
-
update_issue_labels is annotated destructiveHint: false but replaces (removes) existing labelsPossibly taken @shhhhhhjokerist claimed this 6 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 69/100
github/github-mcp-server#3760 · 1 comment ·
Maintainers usually reply within 2 days
-
docs(install-claude): "environment variable" examples put the PAT in argv and the saved configPossibly taken @shhhhhhjokerist claimed this 6 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
github/github-mcp-server#3758 ·
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 69/100
github/github-mcp-server#3729 ·
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
github/github-mcp-server#3722 ·
Maintainers usually reply within 2 days
-
Insiders Feedback: PR created UI doesn't link to the PRPossibly taken @genius-0963 claimed this 12 days ago. Openbug insiders user-experience
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
github/github-mcp-server#3658 ·
Maintainers usually reply within 2 days
All issues in github/github-mcp-server
Similar issues
-
kind/features
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
TencentBlueKing/bk-nodemgr#4017 ·
Maintainers usually reply within 1 day
-
ssa: wait errors drop the kstatus message, so health check failures don't say whyPossibly taken @schdief claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
equinor/radix-operator#2066 ·
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
microsoft/terraform-provider-msgraph#188 · 1 reaction ·
Maintainers usually reply within 1 day