Fix needsThinkingRecovery to require tool loop context

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Badri Narayanan S
2026-01-03 23:24:52 +05:30
parent dc65499c49
commit 12e427e9d5
2 changed files with 12 additions and 11 deletions

View File

@@ -83,7 +83,7 @@ export function convertAnthropicToGoogle(anthropicRequest) {
let processedMessages = messages;
const targetFamily = isClaudeModel ? 'claude' : isGeminiModel ? 'gemini' : null;
if (isThinking && targetFamily && needsThinkingRecovery(messages, targetFamily)) {
if (isThinking && targetFamily && needsThinkingRecovery(messages)) {
logger.debug(`[RequestConverter] Applying thinking recovery for ${targetFamily}`);
processedMessages = closeToolLoopForThinking(messages, targetFamily);
}