mirror of
https://github.com/Nezumi-2711/9router.git
synced 2026-09-22 20:00:47 +00:00
Some OpenAI-compatible providers emit optional string tool parameters as empty strings (e.g. pages: "") instead of omitting them. Claude Code rejects pages: "" as invalid, breaking the Read tool for non-PDF files routed through 9router. Add sanitizeToolArguments() that parses tool-call arguments and removes known optional empty-string fields before emitting input_json_delta back to Claude format. Currently handles the Read tool pages field specifically. Includes regression test. Fixes #1278 Co-authored-by: JoJo <noreply@github.com>