diff --git a/open-sse/handlers/chatCore.ts b/open-sse/handlers/chatCore.ts index 820692030a..2fddcee352 100644 --- a/open-sse/handlers/chatCore.ts +++ b/open-sse/handlers/chatCore.ts @@ -185,10 +185,17 @@ export async function handleChatCore({ // Translate request (pass reqLogger for intermediate logging) let translatedBody = body; + const isClaudePassthrough = sourceFormat === FORMATS.CLAUDE && targetFormat === FORMATS.CLAUDE; try { if (nativeCodexPassthrough) { translatedBody = { ...body, _nativeCodexPassthrough: true }; log?.debug?.("FORMAT", "native codex passthrough enabled"); + } else if (isClaudePassthrough) { + // Claude-to-Claude passthrough: forward body completely untouched. + // No translation, no field stripping, no thinking normalization. + // We are just a gateway -- do not interfere with the request in any way. + translatedBody = { ...body }; + log?.debug?.("FORMAT", "claude->claude passthrough -- forwarding untouched"); } else { translatedBody = { ...body }; diff --git a/open-sse/translator/index.ts b/open-sse/translator/index.ts index ce3f353f60..5b75f54685 100644 --- a/open-sse/translator/index.ts +++ b/open-sse/translator/index.ts @@ -131,7 +131,7 @@ export function translateRequest( } // Final step: prepare request for Claude format endpoints - if (targetFormat === FORMATS.CLAUDE) { + if (targetFormat === FORMATS.CLAUDE && sourceFormat !== FORMATS.CLAUDE) { result = prepareClaudeRequest(result, provider); }