skip all modifications for same-format requests (lossless passthrough)#468
Conversation
…sless passthrough) Move normalizeThinkingConfig, ensureToolCallIds, fixMissingToolResponses, filterToOpenAIFormat, and prepareClaudeRequest inside !isSameFormat guard to ensure Claude→Claude and OpenAI→OpenAI requests are truly lossless without any normalization or modification steps.
|
Hey @kwanLeeFrmVi — thank you so much for this PR! Really appreciate the idea of skipping unnecessary transformations for same-format requests. Sorry for the delayed response, things have been quite busy on our end. We loved the concept, but ended up going with a slightly different approach: instead of checking The reason: different providers have different request signatures and special fields. A blanket same-format check could cause issues when users switch providers mid-session — provider-specific fields from one provider might leak into requests for another, resulting in errors or unexpected behavior. Thanks again for the contribution — it sparked a solid improvement! 🙏 |
Move normalizeThinkingConfig, ensureToolCallIds, fixMissingToolResponses, filterToOpenAIFormat, and prepareClaudeRequest inside !isSameFormat guard to ensure Claude→Claude and OpenAI→OpenAI requests are truly lossless without any normalization or modification steps.