Repository navigation
Conversation
|
Codex review: needs maintainer review before merge. Reviewed August 26, 2026, 9:57 PM ET / August 27, 2026, 01:57 UTC. ClawSweeper reviewWhat this changesThe 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 provenancePossible regression — suspected (reviewed change). No predecessor PR is attributed. Merge readinessKeep 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 Review scores
Verification
Live VerificationCommand: Result: PASS (completed) Assertions:
How this fits togetherAgent 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]
Before merge
Agent review detailsSecurityNone. PR surfaceSource -6, Tests +181, Other -1. Total +174 across 5 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest 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. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (9 earlier review cycles; latest 8 shown)
|
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]>
be39646 to
48ee817
Compare
Real-provider behavior proof (after-fix, redacted)Ran the fix against a real Alibaba MaaS token-plan OpenAI-compatible endpoint (
Notes:
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. |
|
Merged via squash.
|
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.
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 enabledthinkingLevelMap.offmappings, the Fable enabled fallback, and native Sonnet/Opus off exceptions remain intact. Ordinary explicitoff: nullmappings still leave the choice to the transport; missing ornonemappings preserve literaloff. 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
be39646009c40da4f3d8bb4d84f10155e97afe3fthrough the actualAgent→ 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:offreasoning_effort: "none"323, terminalstop, 4.984 shighreasoning_effort: "high"lengthat the 256-token cap, 15.574 s; no final answer claimedThis 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_effortdialect is different from vLLM'sqwen-chat-templatedialect; 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):
off, declaredqwendialectenable_thinking: falseoff, declaredqwendialectenable_thinking: falseoff, declaredqwen-chat-templatedialectchat_template_kwargs.enable_thinking: falseoffandthinkingLevelMap.off: nullenable_thinking: false(unchanged pre-PR behavior)offandthinkingLevelMap.off: nullenable_thinking: true(unchanged absent-option provider default)high, either Qwen dialectenable_thinking: truechat_template_kwargs.enable_thinking: true(unchanged default)autoand explicitoffreasoningpropertyautoandhighreasoning: { effort: "high", summary: "auto" }reasoningproperty without a summary;highwith summaryauto(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 receivesnone. Paired direct-provider regressions separately retain native OpenAInoneand 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 senthigh. 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
offwas clamped to a supported level, while managed requests changed from their existing enabled default to disabled. The correction preservesundefinedfor ordinaryoff: nullmappings 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 main42112dd86ec3010cb14011d7514c82063b12974a. The resulting tested candidate tree is8878ba9aa90af678734c432cae3ad2f095ef1d04; 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 tipbe39646009c40da4f3d8bb4d84f10155e97afe3fwas 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:
git diff --check: clean. This is focused typed lint, not a full-repository typecheck.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
thinkingFormatcontract.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]