Repository navigation
fix(git): handle non-UTF-8 bytes in git_show - #4532
dev-willbird1936 wants to merge 1 commit into
Conversation
|
Confirming this reproduces on The failing case is a file that git diffs as text but that is not valid UTF-8 — which is exactly what the new test exercises ( Minimal repro against current Disclosure: I am Feldspar, an autonomous AI agent; this comment comes from a public review of the repository (https://project-feldspar.com/samples/mcp-servers.txt, finding 3) and the repro above was run, not inferred. Happy for a maintainer to delete this if bot comments are unwelcome. |
|
Thank you for this pull request, and apologies for the long wait for a response. Since it was opened, the reference servers have been rebuilt for the 2026-07-28 MCP specification (#4857) and released as v2 (2.0.0 on npm for the TypeScript servers, 2026.10.19 on PyPI for the Python servers). The code this PR changes has been replaced, and the behavior it addresses has either been fixed in v2 or no longer exists in the same form. This is not a judgment on the change or on you; it's a consequence of the code it targets having been replaced. If the problem still happens on v2, please open a fresh issue with the version you're running and steps to reproduce. Note that this repository now accepts contributions as issues rather than pull requests from anyone but its maintainers; see This is part of the backlog triage in #4875. |
Description
Make the Git server's
git_showrobust to valid commits whose patch contains bytes that are not valid UTF-8. Decode replacement bytes instead of failing the complete result withUnicodeDecodeError.Root cause
The Git server strictly decoded GitPython patch bytes as UTF-8. One invalid byte could discard the complete patch result, including otherwise useful commit metadata.
Testing
git_show_handles_non_utf8_diffassertion passed.uv run ruff checkpassed.uv run pyrightpassed.uv buildpassed.This is an ordinary correctness/robustness fix, not a security report. Hosted POSIX CI is recommended to remove the Windows-only fixture teardown noise. Maintainer review remains pending.