openclaw - 💡(How to fix) Fix [Bug]: BUG FIX: Gemini/Google models stalling mid-response / LLM request timed out (120s) [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#80461Fetched 2026-05-11 03:14:21
View on GitHub
Comments
1
Participants
2
Timeline
4
Reactions
3
Timeline (top)
labeled ×2closed ×1commented ×1

Google Gemini models successfully complete their streaming responses, but OpenClaw fails to detect the end of the stream, hanging indefinitely until the 120s idle watchdog aborts the request.

Error Message

lane task error: lane=main durationMs=134161 error="FailoverError: LLM request timed out." This forces an unnecessary failover or session error.

Root Cause

Google Gemini models successfully complete their streaming responses, but OpenClaw fails to detect the end of the stream, hanging indefinitely until the 120s idle watchdog aborts the request.

Fix Action

Fix / Workaround

Temporary workaround verified: Manually updating the dependency via npm install @google/[email protected] inside OpenClaw's global installation directory fixes the bug completely while maintaining generateContentStream API compatibility.

Code Example

Direct Node.js fetch testing on the host confirmed that Google's SSE stream ends with finishReason: "STOP" and closes the connection without sending a [DONE] marker.
The bundled SDK @google/genai@1.52.0 fails to signal stream completion to OpenClaw's for await loop.
Google's official changelog for @google/genai@2.0.0 documents: "Bug Fix: timeout not functioning".
Manually upgrading the SDK via npm install @google/genai@2.0.1 --save inside the global OpenClaw directory immediately and completely resolved the issue in our environment.
RAW_BUFFERClick to expand / collapse

Bug type

Behavior bug (incorrect output/state without crash)

Beta release blocker

No

Summary

Google Gemini models successfully complete their streaming responses, but OpenClaw fails to detect the end of the stream, hanging indefinitely until the 120s idle watchdog aborts the request.

Steps to reproduce

  1. Set the active model to any Google provider model (e.g., google/gemini-3-flash-preview or google/gemini-2.5-pro).
  2. Send a prompt to the agent via any channel (e.g., WhatsApp or CLI).
  3. Observe that the model generates and delivers the complete text response.
  4. Observe that OpenClaw's session remains in a processing state and does not yield.
  5. Wait ~120 seconds.
  6. Observe the log emitting FailoverError: LLM request timed out and the session either erroring out or falling back to the next provider in the chain.

Expected behavior

OpenClaw should immediately detect the end of the SSE stream once the model sends finishReason: "STOP" and cleanly close the turn without waiting for the idle watchdog timeout, as observed when using Anthropic or DeepSeek models.

Actual behavior

The text finishes generating visibly to the user, but the session stalls. After ~120 seconds, the logs show: diagnostic: stalled session ... reason=active_work_without_progress lane task error: lane=main durationMs=134161 error="FailoverError: LLM request timed out." This forces an unnecessary failover or session error.

OpenClaw version

2026.5.7 (eeef486)

Operating system

Ubuntu 24 LTS (Linux 6.8.0-111-generic x64)

Install method

npm global

Model

Gemini Family

Provider / routing chain

google/gemini-3-flash-preview / google/gemini-3.1-pro-preview / google/gemini-2.5-pro || openclaw -> google (direct via @google/genai SDK)

Additional provider/model setup details

Relevant config lives in ~/.openclaw/openclaw.json under auth.profiles.google:default. Issue isolates to the Google provider; Anthropic (claude-opus-4-7) and DeepSeek (deepseek-v4-pro) on the same host correctly detect stream completion.

Logs, screenshots, and evidence

Direct Node.js fetch testing on the host confirmed that Google's SSE stream ends with finishReason: "STOP" and closes the connection without sending a [DONE] marker.
The bundled SDK @google/[email protected] fails to signal stream completion to OpenClaw's for await loop.
Google's official changelog for @google/[email protected] documents: "Bug Fix: timeout not functioning".
Manually upgrading the SDK via npm install @google/[email protected] --save inside the global OpenClaw directory immediately and completely resolved the issue in our environment.

Impact and severity

Affected: All users relying on Google/Gemini models for primary generation. Severity: High (breaks multi-turn flow, causes massive artificial latency, burns fallback budgets, triggers watchdog aborts). Frequency: Always (100% of observed Google generation attempts). Consequence: Users experience a 2-minute stall after every response, breaking real-time chat UX and wasting API credits if fallback chains are triggered.

Additional information

Temporary workaround verified: Manually updating the dependency via npm install @google/[email protected] inside OpenClaw's global installation directory fixes the bug completely while maintaining generateContentStream API compatibility.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

FAQ

Expected behavior

OpenClaw should immediately detect the end of the SSE stream once the model sends finishReason: "STOP" and cleanly close the turn without waiting for the idle watchdog timeout, as observed when using Anthropic or DeepSeek models.

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

openclaw - 💡(How to fix) Fix [Bug]: BUG FIX: Gemini/Google models stalling mid-response / LLM request timed out (120s) [1 comments, 2 participants]