mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-07-26 09:52:11 +03:00
fix: strip _claudeCodeRequiresLowercaseToolNames before serialization
The sentinel field set by remapToolNamesInRequest() was being included in the JSON body sent to Anthropic, which rejects unknown top-level fields with 400 invalid_request_error. Stripped before JSON.stringify in both code paths: - buildAndSignClaudeCodeRequest (CC bridge / anthropic-compatible-cc-*) - base executor serialization path (native claude/ provider) Pre-existing bug, not introduced by issue #2260 changes.
This commit is contained in:
@@ -856,6 +856,11 @@ export class BaseExecutor {
|
||||
// CLI fingerprint ordering — always-on for native Claude OAuth, opt-in
|
||||
// for other providers. Header + body field order is itself a fingerprint.
|
||||
let finalHeaders = headers;
|
||||
// Strip internal sentinel fields set by remapToolNamesInRequest before
|
||||
// serializing — Anthropic rejects unknown top-level fields (issue #2260).
|
||||
delete (transformedBody as Record<string, unknown>)[
|
||||
"_claudeCodeRequiresLowercaseToolNames"
|
||||
];
|
||||
let bodyString = JSON.stringify(transformedBody);
|
||||
|
||||
const shouldFingerprint =
|
||||
|
||||
@@ -354,7 +354,8 @@ export async function buildAndSignClaudeCodeRequest(
|
||||
obfuscateInBody(body);
|
||||
}
|
||||
|
||||
// Step 7: Serialize with CCH placeholder
|
||||
// Step 7: Serialize with CCH placeholder (strip internal sentinel fields)
|
||||
delete (body as Record<string, unknown>)["_claudeCodeRequiresLowercaseToolNames"];
|
||||
const serialized = JSON.stringify(body);
|
||||
|
||||
// Step 8: Sign with xxHash64
|
||||
|
||||
Reference in New Issue
Block a user