Skip to content

gaia2-cli: GAIA2_OPENCLAW_FORWARD_REASONING=0 keeps model reasoning out of OpenClaw context - #113

Draft
johnh2o2 wants to merge 1 commit into
facebookresearch:mainfrom
johnh2o2:fix/openclaw-reasoning-context
Draft

johnh2o2 wants to merge 1 commit into
facebookresearch:mainfrom
johnh2o2:fix/openclaw-reasoning-context

Conversation

@johnh2o2

@johnh2o2 johnh2o2 commented Oct 15, 2026 •

Copy link
Copy Markdown

Change class: Reliability / correctness — not an agent-exploit vector.

Summary

GAIA2_OPENCLAW_FORWARD_REASONING=0 stops a backend's message.reasoning from being forwarded into OpenClaw's context (unset keeps today's behavior).

Consequence addressed

completionToSSE forwarded message.reasoning as delta.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 is 0/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.mjs with the incoming Gemini thought-signature fix (merge order will matter).


Part of a set of isolated gaia2-cli fixes developed while building an audio benchmark on top of the GAIA2 harness. Draft; no reviewers assigned yet.

…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.
@meta-cla meta-cla Bot added the cla signed label Oct 15, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant