Skip to content

[Bug]: rawText empty on assistant_message_end after tool call with response > ~150 tokens (Google Gemini provider) #78838

Closed

Description

@Naxos-coder

Bug type

Regression (worked before, now fails)

Beta release blocker

Yes

Summary

Environment:

  • OpenClaw: 2026.5.3 and 2026.5.6 (both affected)
  • Provider: google/gemini-2.5-flash AND gemini-3.1-pro-preview
  • OS: macOS Tahoe 26.4.1, Mac Studio M4 Max
  • Node: v25.9.0

Summary:
After a tool call (exec), when Gemini final response
exceeds ~150-200 tokens, rawText is empty in
assistant_message_end. This causes embedded run timeout.

Steps to reproduce

  1. Enable OPENCLAW_RAW_STREAM=1
  2. Send: "exec ls *.md and analyze each file in detail"
  3. Observe raw-stream.jsonl

Expected behavior

[assistant_message_end] rawText: "Les fichiers..." ✅

Actual behavior

[assistant_message_end] rawText: '' ❌
→ embedded run timeout after 180s

OpenClaw version

  • OpenClaw: 2026.5.3 and 2026.5.6 (both affected)

Operating system

  • OS: macOS Tahoe 26.4.1, Mac Studio M4 Max

Install method

  • Node: v25.9.0

Model

  • Provider: google/gemini-2.5-flash AND gemini-3.1-pro-preview

Provider / routing chain

  • Provider: google/gemini-2.5-flash AND gemini-3.1-pro-preview

Additional provider/model setup details

NOT affected:
ollama/qwen3:14b (naxos-smart) → works correctly
→ Confirms bug is in Gemini-specific parser layer,
not in OpenClaw tool call orchestration layer

Logs, screenshots, and evidence

Impact and severity

No response

Additional information

No response

Activity

  1. clawsweeper commented on May 7, 2026

    @clawsweeper
    Contributor

    Thanks for the context here. I did a careful shell check against current main, and this is already implemented.

    Close: current main addresses the reported Google/Gemini post-tool empty final turn by routing direct Google/Vertex Gemini reasoning to native mode, and the proof commit is contained in v2026.6.8-beta.1.

    I found the merged PR that appears to have closed this: #92738: Forward suppressed-source progress for message-tool channel replies.

    So I’m closing this as already implemented rather than keeping a duplicate issue open.

    Review details

    Best possible solution:

    Keep the native-reasoning Google provider implementation and close this report as covered by current main and v2026.6.8-beta.1.

    Do we have a high-confidence way to reproduce the issue?

    Yes from source for the implicated shape: current comments and tests identify tagged Google reasoning as leaving a post-tool turn empty, matching the reported empty assistant end text. No live Gemini reproduction was run in this read-only review.

    Is this the best way to solve the issue?

    Yes: using native Gemini reasoning for direct Google/Vertex providers is a provider-owned fix that avoids tagged <think>/<final> prompt behavior while leaving Gemini CLI tagged.

    Security review:

    Security review: This is an issue triage with no patch under review and no security-sensitive report.

    AGENTS.md: found and applied where relevant.

    What I checked:

    • Repository policy read: Root and scoped extension AGENTS.md files were read and applied; provider runtime behavior belongs in the Google plugin and needs source, tests, current behavior, and history proof before close. (AGENTS.md:1, f1b8827d20c8)
    • Current source fixes the empty post-tool mode: Direct Google/Vertex Gemini now resolves reasoning output to native mode; the code comment documents tagged mode as opening before a tool call and leaving the post-tool turn empty. (extensions/google/provider-registration.ts:27, f1b8827d20c8)
    • Regression coverage for the routing decision: Google plugin tests assert direct Google Gemini resolves to native reasoning while Gemini CLI remains tagged, preserving the provider-specific fix boundary. (extensions/google/index.test.ts:37, f1b8827d20c8)
    • Raw stream projection path: assistant_message_end.rawText is derived from extractAssistantText(assistantMessage), so avoiding an empty assistant message is the relevant fix path for the reported raw-stream symptom. (src/agents/embedded-agent-subscribe.handlers.messages.ts:919, f1b8827d20c8)
    • Git history provenance: Blame attributes the current native Google reasoning-mode guard and post-tool-empty comment to commit a15427d. (extensions/google/provider-registration.ts:27, a15427d605fe)
    • Fix commit metadata: The proof commit is fix(auto-reply): deliver channel message-tool final replies, committed at 2026-06-14T18:18:20+05:30, and touched the Google provider registration/tests plus embedded message handling. (a15427d605fe)

    Likely related people:

    • ragesaq: Blame attributes the current Google provider native-reasoning guard and the post-tool-empty comment to the proof commit. (role: recent current-main contributor; confidence: medium; commits: a15427d605fe; files: extensions/google/provider-registration.ts, extensions/google/index.test.ts, src/agents/embedded-agent-subscribe.handlers.messages.ts)
    • steipete: History shows repeated Google transport/provider work, including the move of Gemini transport into the Google plugin. (role: feature-history contributor; confidence: medium; commits: 85826c83e4a1, 1af8bd90c337; files: extensions/google/transport-stream.ts, extensions/google/index.test.ts)
    • vincentkoc: History shows adjacent Google/provider and shared transport test work on the same reviewed surfaces. (role: recent adjacent contributor; confidence: medium; commits: 8c802aa68351, c03f97f95411, 356110c52f79; files: extensions/google/transport-stream.ts, extensions/google/index.test.ts)

    Codex review notes: model internal, reasoning high; reviewed against f1b8827d20c8; fix evidence: merged PR #92738, release v2026.6.8-beta.1, commit a15427d605fe.

  2. barnacle-openclaw commented on May 31, 2026

    @barnacle-openclaw

    This issue has been automatically marked as stale due to inactivity.
    Please add updates or it will be closed.

  3. added
    P2Normal backlog priority with limited blast radius.
    impact:message-lossChannel message delivery can be lost, duplicated, or misrouted.
    on Jun 14, 2026
  4. locked as resolved and limited conversation to collaborators on Jun 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Normal backlog priority with limited blast radius.bugSomething isn't workingimpact:message-lossChannel message delivery can be lost, duplicated, or misrouted.regressionBehavior that previously worked and now failsstaleMarked as stale due to inactivity

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions