mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-08-01 21:02:12 +03:00
remapToolNamesInRequest() set body._claudeCodeRequiresLowercaseToolNames = true when a request contained only lowercase tool names. The flag had no readers in src/ or open-sse/ (verified by repo-wide grep) and leaked into the outgoing Anthropic /v1/messages payload, causing HTTP 400: "_claudeCodeRequiresLowercaseToolNames: Extra inputs are not permitted" The response-side lowercase remap via remapToolNamesInResponse(text, true) is unconditional and does not depend on this flag, so removing it is a no-op for the response path while fixing the request path. Adds tests/unit/claude-code-tool-remapper-flag-leak.test.ts as a regression guard with 5 cases covering all-lowercase, all-TitleCase, mixed-case, and a flag-leak sweep across all input shapes.