Skip to content

fix(agent-core): preserve explicit reasoning off through Agent Core handoff - #120020

Merged
steipete merged 1 commit into
openclaw:mainfrom
xiaobao-k8s:fix/issue-119959-reasoning-off-passthrough
Aug 27, 2026
Merged

steipete merged 1 commit into
openclaw:mainfrom
xiaobao-k8s:fix/issue-119959-reasoning-off-passthrough

Conversation

@xiaobao-k8s

@xiaobao-k8s xiaobao-k8s commented Aug 6, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Agents configured with a supported thinking-off selection could still send enabled-thinking requests to managed Qwen providers. The same problem affects the Agent's own default off state. Managed Responses can likewise select high reasoning when a summary is requested, despite the Agent selecting off.

Why This Change Was Made

The repair belongs in resolveAgentReasoningOption, where off intent was discarded as an absent transport option and managed completions defaulted it to high. Model-owned enabled thinkingLevelMap.off mappings, the Fable enabled fallback, and native Sonnet/Opus off exceptions remain intact. Ordinary explicit off: null mappings still leave the choice to the transport; missing or none mappings preserve literal off. A single-use Set and casting type guard are replaced by direct switch narrowing. Standalone transport defaults and direct-provider normalization are unchanged.

Production LOC: +15/-21 (net -6). Tests: +223/-42 (net +181). Assertion-baseline maintenance: -1 line, recording the removed cast. No new configuration, public API, persistence, or security policy.

User Impact

Agents no longer silently enable managed-provider thinking after a supported off selection. Models that explicitly declare off unsupported keep their existing provider-owned behavior, including native Anthropic exceptions.

Evidence

Live inference was verified on head be39646009c40da4f3d8bb4d84f10155e97afe3f through the actual Agent → embedded stream resolver → managed OpenAI-compatible transport → transparent HTTP proxy → Ollama 0.33.0 / Qwen3.5:4b. The temporary model used a 4096-token context. Two serial requests used the same synthetic arithmetic prompt, a 256-token output cap, and a 45-second deadline, with no retries or raw reasoning logged:

Agent selection Actual request HTTP Reasoning / visible characters Observed outcome
off reasoning_effort: "none" 200 0 / 3 Correct answer 323, terminal stop, 4.984 s
high reasoning_effort: "high" 200 494 / 0 Terminal length at the 256-token cap, 15.574 s; no final answer claimed

This addresses the latest ClawSweeper rank-up request with actual Qwen inference across the repaired shared Agent handoff, not a generated SSE response. Ollama's supported reasoning_effort dialect is different from vLLM's qwen-chat-template dialect; this is not live vLLM, LM Studio frontend, or chat-template-flag inference proof. The installed standalone llama.cpp backend rejected the available Qwen3.5 model's rope metadata before listening or inference, and the other installed small Qwen templates did not support the flag. No new model was downloaded. The temporary model was unloaded, its server stopped, and temporary storage removed; the original LM Studio and Ollama services remained available with no models loaded.

The regression uses the real Agent, resolveEmbeddedAgentStreamFn, managed runtime, and provider SDK against a loopback HTTP server returning SSE. It captures the JSON actually received over HTTP, rather than substituting a mocked stream or stopping at an options callback. Only synthetic credentials and a local test endpoint are used; this is not an authenticated vLLM deployment test.

Observed request fields after the repair (unless a mapping is named, the model has no off override):

Actual request path Received reasoning fields
Agent with explicit off, declared qwen dialect enable_thinking: false
Agent with its default off, declared qwen dialect enable_thinking: false
Agent with explicit/default off, declared qwen-chat-template dialect chat_template_kwargs.enable_thinking: false
Direct Qwen with explicit/default Agent off and thinkingLevelMap.off: null Corresponding enable_thinking: false (unchanged pre-PR behavior)
Managed Qwen with explicit/default Agent off and thinkingLevelMap.off: null Corresponding enable_thinking: true (unchanged absent-option provider default)
Agent with high, either Qwen dialect Corresponding enable_thinking: true
Standalone managed Qwen, no reasoning option chat_template_kwargs.enable_thinking: true (unchanged default)
Agent managed Responses with summary auto and explicit off No reasoning property
Agent managed Responses with summary auto and high reasoning: { effort: "high", summary: "auto" }
Standalone managed Responses, no reasoning option No reasoning property without a summary; high with summary auto (unchanged defaults)

For the nonnative Responses endpoint, existing payload policy deliberately strips effort: "none"; omission is the correct wire assertion, not a claim that the proxy receives none. Paired direct-provider regressions separately retain native OpenAI none and ChatGPT Responses omission for both absent and explicit-off inputs.

Before the production edit, the same managed HTTP regression had five failures: four explicit/default Agent-off Qwen cases sent true, and the Responses-summary off case sent high. After the repair, all pass.

The subsequent exact-head review identified a real unsupported-off regression in the candidate. An expanded HTTP matrix reproduced eight failures across both Qwen dialects and explicit/default Agent off: direct requests changed from disabled to enabled because literal off was clamped to a supported level, while managed requests changed from their existing enabled default to disabled. The correction preserves undefined for ordinary off: null mappings and restores both previous behaviors. It does not impose a new cross-provider default. Native Sonnet/Opus null exceptions and the Fable fallback remain covered.

Initial before/after proof baseline: 0569c6ea6b401ac15cbffa171be664d8dcf08f52. The branch was refreshed by a normal merge from verified main 42112dd86ec3010cb14011d7514c82063b12974a. The resulting tested candidate tree is 8878ba9aa90af678734c432cae3ad2f095ef1d04; all four reviewed code/test files remain byte-identical, and the diff against that main snapshot adds only the single baseline deletion to the reviewed repair.

The refresh addresses an actual CI failure: the refactor removed the old cast, and the assertion ratchet correctly required its allowance to shrink from one to zero. The old contributor branch predates the baseline file, so importing the current main history was necessary to remove that entry safely. No other allowance was changed or increased.

The final head is 48ee817b59b2a42dff3d6d06e4d60d89e75be68f, a metadata-only replacement with that exact same tested tree and main parent. The earlier contributor message contained an obsolete issue-closing reference, while the repository's squash default copies commit messages. The replacement removes that closing reference so #119959 stays open. It retains xiaobao's original author identity and date plus the explicit co-author credit; the previous tip be39646009c40da4f3d8bb4d84f10155e97afe3f was backed up before a lease-protected update. No source, test, or baseline content changed. The live results above were collected on that previous head and apply to the identical tree; hosted CI is required again for the new head.

Validation

All runs used the repository runner with one worker. The focused command was:

OPENCLAW_VITEST_MAX_WORKERS=1 node scripts/run-vitest.mjs \
  src/agents/openai-thinking-contract.test.ts \
  packages/agent-core/src/reasoning.test.ts \
  packages/agent-core/src/agent-loop.test.ts \
  --configLoader runner --maxWorkers 1
  • Focused Agent/reasoning/HTTP contracts: 148 tests passed across 3 files, including 60 HTTP/direct contracts.
  • Managed-completions, Anthropic, Google, Mistral, simple-option and Bedrock siblings: 266 tests passed across 6 files; combined 414 tests across 9 files.
  • After the main refresh, the same 148 focused tests passed again on the refreshed tree, and the canonical assertion-safety ratchet passed against the verified main snapshot. The six sibling files were not rerun for the baseline-only maintenance; all four repair files are unchanged.
  • Exact four-file type-aware lint, formatter, and git diff --check: clean. This is focused typed lint, not a full-repository typecheck.
  • Fresh Codex review through P2 and independent source/contract reviews found no actionable defects in the corrected patch. The metadata-only final head received another clean P2 review.
  • Final head 48ee817b59b2a42dff3d6d06e4d60d89e75be68f: full CI run 33031330182 passed on its first attempt, including the required CI gate. The complete 256-check inventory has no failures or pending checks; one canceled nonrequired labeling workflow is excluded under repository policy. The latest completed ClawSweeper review on this head accepts the live proof and has no code findings; its remaining exact-head CI request is now satisfied.

The ClawSweeper managed-HTTP evidence requests and unsupported-null mapping finding are addressed, with the additional real-inference evidence and its precise limits above. The suggestion that managed null must disable thinking is intentionally not applied: that would change the transport's preexisting absent-option default. The actual direct-route regression is repaired and both routes are tested. Exact-head checks will be refreshed without rebasing merely for main drift. A real vLLM deployment remains untested; the observed Ollama model output does not establish behavior for an undeclared compatibility dialect. Existing thinking and vLLM documentation already describe the required thinkingFormat contract.

Related issue and credit

Related: #119959. Keep that issue open: its reported configuration does not declare the Qwen compatibility dialect, and its complete runtime case has not been reproduced here. This PR repairs the independently demonstrated Agent handoff defect, not every possible cause of the reported symptom.

Original implementation and contract updates by @xiaobao-k8s. Contributor author identity, original author date, and explicit co-author credit are retained in the metadata-only replacement.

Co-authored-by: xiaobao [email protected]

@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P2 Normal backlog priority with limited blast radius. labels Aug 7, 2026
@clawsweeper

clawsweeper Bot commented Aug 7, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 26, 2026, 9:57 PM ET / August 27, 2026, 01:57 UTC.

ClawSweeper review

What this changes

The PR changes Agent Core so supported explicit or default reasoning-off selections reach managed and direct OpenAI-compatible transports without overriding models that declare off unsupported.

Regression provenance

Possible regression — suspected (reviewed change). No predecessor PR is attributed.

Merge readiness

⚠️ Ready for maintainer review - 2 items remain

Keep open: current main still omits the Agent’s explicit off intent on this handoff, while the candidate preserves it and retains the explicit unsupported-off behavior. The patch has no blocking correctness finding; wait for exact-head hosted checks before merge.

Priority: P1
Reviewed head: 48ee817b59b2a42dff3d6d06e4d60d89e75be68f

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) The patch is a focused shared-owner repair with broad boundary coverage and documented live inference; hosted checks remain pending for the replacement head.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (live_output): The PR body records an after-fix real Agent-to-embedded-managed-transport Ollama/Qwen inference comparison, with off producing no reasoning and high producing reasoning; it identifies the tested content tree as identical to the metadata-only current head.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (live_output): The PR body records an after-fix real Agent-to-embedded-managed-transport Ollama/Qwen inference comparison, with off producing no reasoning and high producing reasoning; it identifies the tested content tree as identical to the metadata-only current head.
Evidence reviewed 7 items Current-main behavior: Current main returns undefined for an off selection unless an enabled fallback or native Anthropic exception applies; the PR changes that missing-map case to literal off while retaining undefined for an explicit null unsupported mapping.
Owner boundary and callers: Initial Agent setup, model changes between turns, and compaction all use the same resolver, so the change belongs in the shared Agent Core owner rather than a provider-specific workaround.
Transport compatibility: The direct OpenAI-completions transport clamps literal off and omits its reasoning effort, while Responses likewise maps off to undefined; this supports preserving the logical off selection through the Agent handoff.
Findings None None.
Security None None.

Live Verification

Command: node scripts/run-vitest.mjs src/agents/openai-thinking-contract.test.ts --configLoader runner --maxWorkers 1

Result: PASS (completed)

[test] starting test/vitest/vitest.unit-fast.config.ts

 RUN  v4.1.11 /tmp/clawsweeper-live-proof-120020-IkHsPL/target

 ✓  unit-fast  src/agents/openai-thinking-contract.test.ts (60 tests) 476ms

 Test Files  1 passed (1)
      Tests  60 passed (60)
   Start at  01:58:38
   Duration  8.60s (transform 6.36s, setup 51ms, import 7.95s, tests 476ms, environment 0ms)

[test] passed 1 Vitest shard in 17.78s
[test] starting test/vitest/vitest.unit-fast.config.ts

 RUN  v4.1.11 /tmp/clawsweeper-live-proof-120020-IkHsPL/target

 ✓  unit-fast  src/agents/openai-thinking-contract.test.ts (60 tests) 446ms

 Test Files  1 passed (1)
      Tests  60 passed (60)
   Start at  01:58:56
   Duration  4.28s (transform 2.16s, setup 25ms, import 3.69s, tests 446ms, environment 0ms)

[test] passed 1 Vitest shard in 13.37s

Assertions:

  • NOT OBSERVED expect_output: OpenAI thinking contract — command exited successfully; expected output was not observed in the captured pane
  • PASS expect_output: Tests

How this fits together

Agent Core translates a session’s thinking level into a stream option, then the embedded Agent runtime sends that option to provider transports. The resulting request determines whether a reasoning-capable model receives a disable signal or its provider-owned default.

flowchart LR
  A[Session thinking selection] --> B[Agent Core resolver]
  C[Model off mapping] --> B
  B --> D[Embedded Agent stream]
  D --> E[Provider transport]
  E --> F[Reasoning request payload]
Loading

Before merge

  • Resolve merge risk (P1) - This intentionally changes outbound reasoning payloads for Agents whose effective setting is off and whose model does not explicitly declare off unsupported; exact-head hosted checks should confirm the covered provider contracts before merge.
  • Complete next step (P2) - No repair lane is needed; this coherent PR should remain open for exact-head hosted validation and normal merge handling.
Agent review details

Security

None.

PR surface

Source -6, Tests +181, Other -1. Total +174 across 5 files.

View PR surface stats
Area Files Added Removed Net
Source 1 15 21 -6
Tests 3 223 42 +181
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 1 0 1 -1
Total 5 238 64 +174

Review metrics

Metric Value Why it matters
Production versus regression coverage production +15/-21 (net -6); tests +223/-42 (net +181); assertion baseline -1 The production change is net-negative and the additional test surface exercises the shared Agent-to-transport contract rather than adding a new configuration or API.

Merge-risk options

Maintainer options:

  1. Validate the replacement head (recommended)
    Let the required checks finish on the metadata-only replacement head before merging the provider-request behavior change.

Technical review

Best possible solution:

Merge the shared resolver repair once the current head’s required checks pass, preserving null as the sole explicit signal to leave an unsupported off choice to the transport.

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

Yes, by source: current main drops off at the shared resolver, and downstream managed Responses can choose a summary reasoning effort when no option arrives. The added loopback HTTP matrix targets that exact Agent-to-transport boundary, though this read-only review did not execute contributor code.

Is this the best way to solve the issue?

Yes. Resolving intent once in Agent Core covers initial runs, continuation model changes, and compaction, while provider transports retain their own handling of literal off and explicit unsupported mappings.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 6ae89b5a8ed6.

Labels

Label changes:

  • add proof: sufficient: Contributor real behavior proof is sufficient. The PR body records an after-fix real Agent-to-embedded-managed-transport Ollama/Qwen inference comparison, with off producing no reasoning and high producing reasoning; it identifies the tested content tree as identical to the metadata-only current head.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🦞 diamond lobster. Replaced prior rating: 🦐 gold shrimp.
  • remove rating: 🦐 gold shrimp: Current PR rating is rating: 🐚 platinum hermit, so this older rating label is no longer current.

Label justifications:

  • P1: An Agent’s explicit off selection can otherwise be silently converted into provider reasoning behavior for affected managed paths.
  • merge-risk: 🚨 auth-provider: The PR intentionally changes reasoning fields sent to OpenAI-compatible provider transports for existing configured models.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🦞 diamond lobster. Replaced prior rating: 🦐 gold shrimp.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Sufficient (live_output): The PR body records an after-fix real Agent-to-embedded-managed-transport Ollama/Qwen inference comparison, with off producing no reasoning and high producing reasoning; it identifies the tested content tree as identical to the metadata-only current head.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body records an after-fix real Agent-to-embedded-managed-transport Ollama/Qwen inference comparison, with off producing no reasoning and high producing reasoning; it identifies the tested content tree as identical to the metadata-only current head.

Evidence

What I checked:

  • Current-main behavior: Current main returns undefined for an off selection unless an enabled fallback or native Anthropic exception applies; the PR changes that missing-map case to literal off while retaining undefined for an explicit null unsupported mapping. (packages/agent-core/src/reasoning.ts:17, 6ae89b5a8ed6)
  • Owner boundary and callers: Initial Agent setup, model changes between turns, and compaction all use the same resolver, so the change belongs in the shared Agent Core owner rather than a provider-specific workaround. (packages/agent-core/src/agent.ts:518, 48ee817b59b2)
  • Transport compatibility: The direct OpenAI-completions transport clamps literal off and omits its reasoning effort, while Responses likewise maps off to undefined; this supports preserving the logical off selection through the Agent handoff. (packages/ai/src/providers/openai-completions.ts:274, 48ee817b59b2)
  • Regression coverage: The added HTTP matrix covers both Qwen payload dialects, managed and direct paths, absent/null/enabled/none off mappings, and off/high selections; it separately covers Responses summaries and standalone defaults. (src/agents/openai-thinking-contract.test.ts:42, 48ee817b59b2)
  • Documented operator contract: The thinking documentation says an explicit /think off session override disables thinking, while unsupported OpenAI targets omit a disabled payload rather than sending an unsupported value. Public docs: docs/tools/thinking.md. (docs/tools/thinking.md:33, 48ee817b59b2)
  • History and release status: Blame attributes the candidate resolver change to this PR head; no release can contain an unmerged head, and current origin/main does not contain the changed resolver behavior. (packages/agent-core/src/reasoning.ts:33, 48ee817b59b2)

Likely related people:

  • xiaobao-k8s: The candidate commit owns the resolver change, and grafted blame attributes the pre-existing resolver lines and new logic to the same contributor; unavailable older promisor objects prevent a deeper complete history trail. (role: resolver feature author and recent area contributor; confidence: medium; commits: 48ee817b59b2; files: packages/agent-core/src/reasoning.ts, src/agents/openai-thinking-contract.test.ts)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Allow the required hosted checks to complete on 48ee817 before merging.

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (9 earlier review cycles; latest 8 shown)
  • reviewed 2026-08-07T02:43:35.077Z sha 6d8ccc904cc1e98acede671348062e84e48a905e :: needs real behavior proof before merge. :: [P1] Exercise the OpenAI-completions payload path
  • reviewed 2026-08-07T03:45:08.333Z sha 6d8ccc904cc1e98acede671348062e84e48a905e :: needs real behavior proof before merge. :: [P1] Exercise the OpenAI-completions payload path
  • reviewed 2026-08-14T22:14:17.422Z sha 6d8ccc904cc1e98acede671348062e84e48a905e :: needs real behavior proof before merge. :: [P1] Exercise the managed OpenAI-completions payload route
  • reviewed August 19, 2026, 8:06 PM ET / August 20, 2026, 00:06 UTC sha unknown :: needs real behavior proof before merge. :: [P1] Prove the reported OpenAI-completions runtime path
  • reviewed 2026-08-20T00:21:05.386Z sha 6d8ccc904cc1e98acede671348062e84e48a905e :: needs real behavior proof before merge. :: [P1] Cover the managed OpenAI-completions payload path
  • reviewed 2026-08-26T01:44:31.979Z sha 6d8ccc904cc1e98acede671348062e84e48a905e :: needs real behavior proof before merge. :: [P1] Cover the managed OpenAI-completions payload route
  • reviewed 2026-08-26T21:27:54.213Z sha b0862b8bcd9277c685e8b530df09c3ae9db30792 :: needs changes before merge. :: [P1] Preserve explicit unsupported-off mappings
  • reviewed 2026-08-27T00:45:25.348Z sha f72367716e84c99042716696ef959f4831256350 :: needs real behavior proof before merge. :: none

@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. labels Aug 7, 2026
@openclaw-barnacle openclaw-barnacle Bot added the agents Agent runtime and tooling label Aug 7, 2026
@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. merge-risk: 🚨 auth-provider 🚨 May break OAuth, tokens, provider routing, model choice, or credentials. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. labels Aug 7, 2026
@clawsweeper clawsweeper Bot added clawsweeper-recovery-stuck P1 High-priority user-facing bug, regression, or broken workflow. and removed P2 Normal backlog priority with limited blast radius. clawsweeper-recovery-stuck labels Aug 16, 2026
@openclaw-barnacle openclaw-barnacle Bot added size: M triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence. and removed size: XS labels Aug 26, 2026
@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Aug 26, 2026
@openclaw-barnacle openclaw-barnacle Bot removed the triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence. label Aug 27, 2026
@clawsweeper clawsweeper Bot added status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. and removed proof: sufficient ClawSweeper judged the real behavior proof convincing. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Aug 27, 2026
Preserve supported explicit and default Agent reasoning off through the
managed transport handoff. Retain unsupported-off transport defaults,
model-owned enabled fallbacks, and native Anthropic exceptions. Replace the
single-use Set and casting guard with direct switch narrowing.

Proved with real Agent-to-embedded-to-managed HTTP/SSE regressions and
provider sibling coverage, plus actual Qwen inference through Ollama's
OpenAI-compatible reasoning-effort dialect. Related: openclaw#119959; the full
reported vLLM configuration remains unverified and that issue remains open.

This metadata-only replacement retains the exact reviewed and tested tree.
It removes an obsolete closing reference from the earlier commit messages
without changing any source, test, or baseline content.

Co-authored-by: xiaobao <[email protected]>
@steipete
steipete force-pushed the fix/issue-119959-reasoning-off-passthrough branch from be39646 to 48ee817 Compare August 27, 2026 01:49
@xiaobao-k8s

Copy link
Copy Markdown
Contributor Author

Real-provider behavior proof (after-fix, redacted)

Ran the fix against a real Alibaba MaaS token-plan OpenAI-compatible endpoint (qwen3.8-max) through both managed embedded-agent and direct transport paths. Harness: local capture proxy in front of the real endpoint, asserting the outbound wire payload + upstream status in the same run.

scenario (after-fix) outbound thinking field upstream
qwen thinking-format, managed transport, Agent thinking=off enable_thinking: false 200
qwen thinking-format, managed transport, Agent thinking=high enable_thinking: true 200
qwen-chat-template thinking-format, managed transport, Agent thinking=off chat_template_kwargs.enable_thinking: false 200
qwen thinking-format, direct transport, Agent thinking=off enable_thinking: false 200

Notes:

  • Explicit Agent thinking=off is preserved through the expandToManagedModel handoff in the format-aware qwen dialect path (enable_thinking: false on the wire), and the same field is respected for the positive control (high → true), so the qwen-dialect branch is symmetrically covered.
  • The qwen-chat-template dialect branch carries the flag in chat_template_kwargs and is preserved false as required.
  • direct transport (no managed handoff) also emits false.
  • All four requests returned 200 from the real endpoint, so the after-fix wire shape is accepted by the upstream provider.

Credentials were provided at runtime and are not included here; host/endpoint details are redacted per repro-cleanup policy.

@clawsweeper requesting re-review of the two remaining items from your 2026-08-27 pass (real setup proof + managed path evidence) — both are now covered above.

@steipete
steipete merged commit c756161 into openclaw:main Aug 27, 2026
261 of 262 checks passed
@steipete

Copy link
Copy Markdown
Contributor

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 27, 2026
Preserve supported explicit and default Agent reasoning off through the
managed transport handoff. Retain unsupported-off transport defaults,
model-owned enabled fallbacks, and native Anthropic exceptions. Replace the
single-use Set and casting guard with direct switch narrowing.

Proved with real Agent-to-embedded-to-managed HTTP/SSE regressions and
provider sibling coverage, plus actual Qwen inference through Ollama's
OpenAI-compatible reasoning-effort dialect. Related: openclaw#119959; the full
reported vLLM configuration remains unverified and that issue remains open.

This metadata-only replacement retains the exact reviewed and tested tree.
It removes an obsolete closing reference from the earlier commit messages
without changing any source, test, or baseline content.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling merge-risk: 🚨 auth-provider 🚨 May break OAuth, tokens, provider routing, model choice, or credentials. P1 High-priority user-facing bug, regression, or broken workflow. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: M status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants