From 7234ac7d90136d7f37c878d653c285402fe5c807 Mon Sep 17 00:00:00 2001 From: admin Date: Sun, 24 May 2026 19:38:28 +0000 Subject: [PATCH] v3.9.1: Fix Gemini stream hang when model returns only function calls --- translate-proxy.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/translate-proxy.py b/translate-proxy.py index 27d820b..c569450 100755 --- a/translate-proxy.py +++ b/translate-proxy.py @@ -4496,8 +4496,8 @@ class Handler(http.server.BaseHTTPRequestHandler): current_tool_calls[call_id] = fc output_items.append({"tool": True}) last_finish = candidates[0].get("finishReason", "") - if OAUTH_PROVIDER == "google-antigravity" and full_text and last_finish: - if last_finish == "MAX_TOKENS" and not current_tool_calls: + if last_finish: + if OAUTH_PROVIDER == "google-antigravity" and last_finish == "MAX_TOKENS" and full_text and not current_tool_calls: print(f"[{self._session_id}] MAX_TOKENS hit ({len(full_text)} chars), auto-continuing...", file=sys.stderr) break stream_finished = True