Repository navigation
Conversation
…enClaw completionToSSE forwards a non-streamed chat-completions message.reasoning to OpenClaw as delta.reasoning. pi-ai (openai-completions) stores it as a thinking block, re-sends it on every later request as `reasoning`, and OpenClaw's tool-result context guard (estimateMessageChars) and compaction estimate count it. With a chat template that never renders past reasoning (Qwen3 thinking, multi-step tool loop), the guard sees up to ~10x the real prompt, blanks tool results and throws "Preemptive context overflow" far below the served context. GAIA2_OPENCLAW_FORWARD_REASONING=0 (false/off/no) drops the reasoning chunk before it reaches OpenClaw. Unset keeps today's behaviour. The raw response in the trace still carries the reasoning.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Change class: Reliability / correctness — not an agent-exploit vector.
Summary
GAIA2_OPENCLAW_FORWARD_REASONING=0stops a backend'smessage.reasoningfrom being forwarded into OpenClaw's context (unset keeps today's behavior).Consequence addressed
completionToSSEforwardedmessage.reasoningasdelta.reasoning; OpenClaw's openai-completions provider stored it as a thinking block, re-sent it on every later request, and counted it in its context guard. With a chat template that never renders past reasoning (e.g. Qwen3 thinking in a multi-step tool loop), the guard saw up to ~10× the real prompt, blanked tool results, and threw "Preemptive context overflow" far below the served context — spurious run failures that depress scores via a harness bug, not an exploit.Changes
launch_request_utils.mjs:forwardedReasoning(msg, env)returns""when the flag is0/false/off/no.launch.mjs: drop the reasoning chunk before OpenClaw when disabled; the raw response/trace still carry it.Testing
containers/openclaw/test_launch_request_utils.mjs(+16) covers the flag.Overlaps
containers/openclaw/launch.mjswith the incoming Gemini thought-signature fix (merge order will matter).Part of a set of isolated
gaia2-clifixes developed while building an audio benchmark on top of the GAIA2 harness. Draft; no reviewers assigned yet.