Symptom
`codedb_read path=codedb.snapshot` (or any file with NUL bytes) succeeds and returns the raw byte content in the MCP response. NULs and control bytes corrupt downstream JSON consumers and burn tokens on content that's never useful to a model.
Repro
`codedb_read path="codedb.snapshot"` returns the binary CDB header + body. `xxd` of the response shows control bytes / NULs.
Failing test
`tests.test.issue-bug5: codedb_read returns binary stub instead of dumping bytes`
Fix
Probe the first 8KB for NUL bytes; if found, replace the response with `binary file: bytes hash:`.
Labels
bug
Symptom
`codedb_read path=codedb.snapshot` (or any file with NUL bytes) succeeds and returns the raw byte content in the MCP response. NULs and control bytes corrupt downstream JSON consumers and burn tokens on content that's never useful to a model.
Repro
`codedb_read path="codedb.snapshot"` returns the binary CDB header + body. `xxd` of the response shows control bytes / NULs.
Failing test
`tests.test.issue-bug5: codedb_read returns binary stub instead of dumping bytes`
Fix
Probe the first 8KB for NUL bytes; if found, replace the response with `binary file: bytes hash:`.
Labels
bug