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