Repository navigation
Description
Summary
When using google/gemini-2.5-pro via the google-generative-ai API, three issues combine to cause rapid session context bloat, aborted runs, and silent Telegram delivery failures.
Issue 1: textSignature Session Bloat (High Severity)
Gemini assistant responses include a textSignature field containing ~15KB of base64 data per response turn. OpenClaw stores these signatures verbatim in the session JSONL history. After 10+ turns, the accumulated signatures alone consume 150KB+, causing:
- Context window bloat (observed: 416K tokens in one session)
- Gemini API timeouts on re-submission of full context
- Compaction failures (session too large to compact)
- Silent message delivery failures (run aborts before reply is sent to Telegram)
Expected: textSignature should either not be stored in session history, be stored separately, or not be re-sent to the model on subsequent turns.
Issue 2: Embedded <think> Tags in Text
Gemini 2.5 Pro embeds <think>...</think> tags directly in the text content field (not as separate thinking type blocks). If OpenClaw treats <think>-prefixed text as internal/thinking content, the reply is suppressed and never delivered to Telegram.
Expected: OpenClaw should either strip <think> tags from the delivered text, or not suppress messages that contain them.
Issue 3: Mixed Text + ToolCall in Same Response
Gemini 2.5 Pro consistently emits text + toolCall in the same response turn. OpenClaw processes the toolCall, gets the result, then emits an empty content: [] as the final stop. The original text from the first part of the response is never delivered to the user.
Expected: Text content from a mixed text+toolCall response should be delivered to the user, not silently dropped.
Reproduction
- Configure an agent with
google/gemini-2.5-proas primary model - Send 5-10 interactive messages via Telegram group topic
- Check session JSONL — each assistant message contains
textSignature(~15KB base64) - After ~10 exchanges, session reaches 150K+ tokens
- Subsequent runs timeout or abort; replies never reach Telegram
Workaround
Switched affected agent to Claude Sonnet 4.6, which does not exhibit these behaviors.
Environment
- OpenClaw 2026.3.13 (61d171a)
- macOS Darwin 24.6.0 (arm64)
- Gemini API key auth (google-generative-ai provider)
- Telegram channel with group topics
Metadata
Metadata
Assignees
Labels
Type
Fields
Priority
Activity
Ryce commentedon Mar 17, 2026
openclaw-barnacle commentedon Apr 29, 2026
This issue has been automatically marked as stale due to inactivity.
Please add updates or it will be closed.
clawsweeper commentedon Apr 29, 2026
Thanks for the report. I checked current
main, but this shell is missing enough reproduction detail to verify a current bug.Close this older, partially addressed report: native Gemini reasoning is fixed in shipped code, while the remaining signature-related failures lack a current-version reproduction.
Review details
Best possible solution:
Preserve replay metadata and investigate any remaining failure using a current-release trace that separates stored bytes, provider token usage, compaction, and delivered output.
Do we have a high-confidence way to reproduce the issue?
No high-confidence current reproduction is established: the supplied steps target 2026.3.13, and no later human comment provides current-release logs or a reduced failing transcript; no runtime tests were executed.
Is this the best way to solve the issue?
Blanket signature removal is not justified: the provider retains signatures as replay metadata, compaction excludes them from assistant token estimates and summaries, and the separate tagged-reasoning conflict already has a shipped repair.
Security review:
Security review: The report establishes reliability concerns without a security-boundary violation.
AGENTS.md: found and applied where relevant.
What I checked:
extensions/google/provider-registration.ts:53, e841ac7c592b)extensions/google/provider-registration.ts, b1bdc29d332f)extensions/google/provider-registration.ts, 383c124cc32f)packages/ai/src/providers/google-messages.ts:146, e841ac7c592b)packages/agent-core/src/harness/compaction/compaction.ts:291, e841ac7c592b)Codex review notes: model internal, reasoning medium; reviewed against 3dc6e49c07fb.
clawsweeper commentedon Apr 29, 2026
Codex review: keeping this open for maintainer follow-up; there is still a little grit to resolve.
Keep open. Current main still has the central Gemini signature-bloat path: Google visible text blocks can persist
textSignature, same-provider replay sends it back asthoughtSignature, and the replay sanitizer only targetsthought_signature/thoughtSignature. Mixed text before tool execution has partial protection now via block flushing, but Gemini remains on tagged reasoning with strict final-tag suppression, so meaningful parts of the report are still unresolved rather than stale or implemented.Required change / next step:
Needs owner decision on Google signature retention/replay and Gemini tagged-versus-native reasoning before an automated fix changes provider replay semantics.
Review details
Best possible solution:
Handle this at the Google provider and replay boundary: preserve required Gemini function-call/native-thinking signatures, bound or avoid replaying stale visible-text signatures, and align Gemini reasoning delivery with native thinking so malformed or final-less tagged output cannot silently suppress user replies.
Acceptance criteria:
What I checked:
part.thoughtSignatureon visible text blocks asactiveBlock.textSignature, so opaque Gemini signatures can enter assistant session history on ordinary text. (extensions/google/transport-stream.ts:706, e46dccb35374)block.textSignatureare emitted as GeminithoughtSignature, so stored visible-text signatures are replayed into subsequent requests. (extensions/google/transport-stream.ts:350, e46dccb35374)thought_signatureand optional camel-casethoughtSignature; it does not remove OpenClaw's stored assistanttextSignaturefield before Google replay. (src/agents/pi-embedded-helpers/bootstrap.ts:11, e46dccb35374)src/plugins/provider-replay-helpers.ts:155, e46dccb35374)google-geministill callsresolveTaggedReasoningOutputMode(), and checked-in tests assert Google provider reasoning mode istagged. (src/plugin-sdk/provider-model-shared.ts:200, e46dccb35374)enforceFinalTagis true, streaming delivery returns empty output until a<final>start tag has appeared, and the checked-in test still asserts no agent payload for final-less assistant text. (src/agents/pi-embedded-subscribe.ts:669, e46dccb35374)Likely related people:
extensions/google/transport-stream.ts,src/plugins/provider-replay-helpers.ts,src/plugin-sdk/provider-model-shared.ts)extensions/google/transport-stream.ts,src/agents/pi-embedded-subscribe.ts,src/agents/pi-embedded-utils.ts)Remaining risk / open question:
Codex review notes: model gpt-5.5, reasoning high; reviewed against e46dccb35374.
64 remaining items
openclaw-barnacle commentedon Oct 7, 2026
This issue has been automatically marked as stale due to inactivity.
Please add updates or it will be closed.