openclaw - 💡(How to fix) Fix [Bug] Gemini 3.1 Pro Preview intermittent 0-token stall persists through 2026.5.10-beta.3

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…

Fix Action

Fix / Workaround

  • Tool schema format: Both parametersJsonSchema and parameters work via raw HTTP
  • Thinking level: HIGH, LOW, and adaptive all work via raw HTTP; the beta.1 first-response retry (which lowers thinking to LOW) doesn't help since thinking level isn't the cause
  • Payload size: 26K+ byte payloads with 33 tools work fine via raw HTTP
  • Connection pool exhaustion: Patched `HT

Code Example

requests.post(
    "https://generativelanguage.googleapis.com/v1beta/models/gemini-3.1-pro-preview:streamGenerateContent?alt=sse&key=***",
    json={
        "contents": [{"role": "user", "parts": [{"text": "..."}]}],
        "systemInstruction": {"parts": [{"text": "...(15K chars)..."}]},
        "tools": [{"functionDeclarations": [...33 tools...]}],
        "generationConfig": {"thinkingConfig": {"includeThoughts": True}}
    },
    stream=True
)
RAW_BUFFERClick to expand / collapse

First off — thank you for the work on beta.3. The config-reread fix (#79947) and the SSRF IPv4 pinning fix (#80078) both directly helped our setup. We know it's been a rough stretch and appreciate how quickly the team is shipping fixes.

Re-opening this as a fresh issue since the original (#80308) was closed. We've done extensive testing and wanted to share everything we found in case it helps narrow things down.

Environment

  • OpenClaw v2026.5.10-beta.3 (6d7dcd9) — also reproduced on v2026.5.9-beta.1
  • Linux/WSL2 6.6.87.2-microsoft-standard-WSL2 (x64), Node v22.22.0
  • Google provider: direct API key, google-generative-ai API
  • Model: gemini-3.1-pro-preview

Expected behavior

gemini-3.1-pro-preview completes tool-heavy isolated subagent sessions normally.

Actual behavior

Gemini 3.1 Pro Preview intermittently stalls with 0 input tokens / 0 output tokens in isolated subagent sessions that include tool schemas. The stall is not recoverable — the session times out after ~2 minutes with no model output.

Reproduction

Spawn 3 parallel isolated subagents on gemini-3.1-pro-preview, each with multi-tool tasks (exec, web_search, read, memory_search). Consistent ~33-66% failure rate across multiple runs:

VersionTest 1Test 2Test 3Pass rate
2026.5.9-beta.1 (run 1)❌ 0-token stall❌ 0-token stall✅ 16s1/3
2026.5.9-beta.1 (run 2)❌ 0-token stall❌ 0-token stall✅ 40s1/3
2026.5.10-beta.3✅ 1m34s❌ 0-token stall✅ 1m40s2/3

Single subagent spawns also stall intermittently. The issue is not limited to parallel execution.

Key finding: raw Google API works 100%

We ran 6 direct HTTP tests against the same endpoint, bypassing OpenClaw entirely:

  • 33 tool schemas (matching full OpenClaw tool set)
  • 15K char system prompt
  • Both parametersJsonSchema and parameters field formats
  • Thinking levels: HIGH, LOW, and adaptive (includeThoughts only)
  • All 6 passed in 3–9 seconds, every time
requests.post(
    "https://generativelanguage.googleapis.com/v1beta/models/gemini-3.1-pro-preview:streamGenerateContent?alt=sse&key=***",
    json={
        "contents": [{"role": "user", "parts": [{"text": "..."}]}],
        "systemInstruction": {"parts": [{"text": "...(15K chars)..."}]},
        "tools": [{"functionDeclarations": [...33 tools...]}],
        "generationConfig": {"thinkingConfig": {"includeThoughts": True}}
    },
    stream=True
)

The Google API handles the full tool-heavy payload fine. The stall is introduced inside OpenClaw's transport/agent layer.

What we ruled out

  • Tool schema format: Both parametersJsonSchema and parameters work via raw HTTP
  • Thinking level: HIGH, LOW, and adaptive all work via raw HTTP; the beta.1 first-response retry (which lowers thinking to LOW) doesn't help since thinking level isn't the cause
  • Payload size: 26K+ byte payloads with 33 tools work fine via raw HTTP
  • Connection pool exhaustion: Patched `HT

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

gemini-3.1-pro-preview completes tool-heavy isolated subagent sessions normally.

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] Gemini 3.1 Pro Preview intermittent 0-token stall persists through 2026.5.10-beta.3