v3.9.1: Fix Gemini stream hang when model returns only function calls
This commit is contained in:
@@ -4496,8 +4496,8 @@ class Handler(http.server.BaseHTTPRequestHandler):
|
|||||||
current_tool_calls[call_id] = fc
|
current_tool_calls[call_id] = fc
|
||||||
output_items.append({"tool": True})
|
output_items.append({"tool": True})
|
||||||
last_finish = candidates[0].get("finishReason", "")
|
last_finish = candidates[0].get("finishReason", "")
|
||||||
if OAUTH_PROVIDER == "google-antigravity" and full_text and last_finish:
|
if last_finish:
|
||||||
if last_finish == "MAX_TOKENS" and not current_tool_calls:
|
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)
|
print(f"[{self._session_id}] MAX_TOKENS hit ({len(full_text)} chars), auto-continuing...", file=sys.stderr)
|
||||||
break
|
break
|
||||||
stream_finished = True
|
stream_finished = True
|
||||||
|
|||||||
Reference in New Issue
Block a user