Repository navigation
fix: keep thinking choices tied to the selected model - #142822
Conversation
Preserve atomic model/provider identity and saved Off descriptors for empty thinking profiles. Carry the target through New Session and cover the shared selector, command, draft and browser consumers.
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. Reviewed September 10, 2026, 8:51 AM ET / 12:51 UTC (Revision 6). ClawSweeper reviewWhat this changesThe Control UI keeps model/provider identities together when resolving thinking choices and preserves saved Off selections when a model offers no choices. Merge readiness✅ Ready for maintainer review Keep open: this remains a focused, useful follow-up to the earlier merged thinking-profile repair. Current main retains the two behaviors being corrected, and review found no introduced blocking defect. Priority: P2 Review scores
Verification
How this fits togetherThe Control UI receives model catalogs and session metadata from the Gateway. Its shared thinking resolver supplies chat commands, effort controls, and new-session controls with supported choices and saved selections. flowchart TD
A[Gateway session metadata] --> D[Shared thinking resolver]
B[Model catalog] --> D
C[New session model target] --> D
D --> E[Supported choices and saved selection]
E --> F[Chat and new session controls]
E --> G[Thinking command validation]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource -6, Tests +338. Total +332 across 7 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Keep one metadata-driven thinking resolver that preserves explicit selections, respects complete model identities, and leaves unknown-support validation to the Gateway. Do we have a high-confidence way to reproduce the issue? Yes, source establishes that current main discards the saved Off descriptor when choices are empty. The partial-identity case is explicitly accepted internal cleanup, not a claimed reachable runtime defect; no local reproduction was run. Is this the best way to solve the issue? Yes. The patch repairs the shared selection owner, reuses the existing draft target, and preserves unknown-support validation without introducing competing settings or provider policy. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against f41b7696c876. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (5 earlier review cycles)
|
|
landpr-approve-unrelated-red |
|
Thanks @obviyus! Proof: The real Gateway retains saved Off after a supported model change to an empty thinking profile. The browser shows Off/no choices, refuses High and sends no unintended thinking update or chat message. Recorded proof remains bound to f5a9412; fresh source-aware review accepted reuse after the typed recorder correction. The identity cleanup is the explicitly approved internal invariant refactor, without a reachable-runtime-bug claim.
Landed using the standing unrelated-CI exception for completed run34475274851/attempt1:
Both failures were assessed against the complete logs and exact tested merge586c15a1/main parent3a135210. No matching main-run failure or green-retry proof is claimed; source inputs and execution paths establish independence. All earlier failed reviews, setup/CI failures and proof limits remain retained. Native profile producers and login work remain separate. |
Related: openclaw#136257 ## What changes Keep model and provider together when the Control UI resolves a thinking profile. A partial session identity cannot borrow its missing half from defaults. New Session forwards the same resolved target. The redundant mixed-identity helper is removed. Keep a saved Off override in the selector descriptor when the profile has no choices. The existing non-reasoning, nonempty Off-only display exception remains. No slider stop or implicit setting write is added. Production code changes by 12 additions and 18 deletions across two files. Ayaan explicitly accepts the partial model/provider cleanup as an internal invariant refactor. It does not claim to fix a reachable runtime bug, and a supported producer of the synthetic partial tuple is not required solely to justify this accepted internal cleanup. Internal source and consumer regression evidence establishes that scope. Ordinary same-version Gateway session and agent producers publish complete identity pairs. The saved-Off lifecycle remains the separately proved public outcome; correctness, security, CI and all other proof gates remain. ## Evidence - Four baseline selector/consumer failures at `1e908f8acaadd9640b470455026f925f02d91c19` and 28 affected candidate passes cover the original contracts and preservation controls. Their full source, commands and results remain retained. - A real Gateway lifecycle now supplies the saved-Off/empty-profile input: create a session with the short `with-effort` reference, save Off while supported, then use `/model thinking-fixture/no-effort`. Public responses resolve the short reference to a complete identity and retain Off after the profile becomes empty. The session-change event carries both model and provider while omitting the profile. - The actual browser shows `Current thinking level: off.` and `Options: none.`, adds no slider, refuses High and leaves the saved value unchanged. Its complete capture contains six CLI calls and 113 non-authentication WebSocket frames. The sole browser setting write changes the model; no `chat.send` or unintended thinking patch occurs. - The new real-Gateway case passed in 8.584 seconds in [job 102857642159](https://github.com/openclaw/openclaw/actions/runs/34473103003/job/102857642159), at `f5a9412eac074626ceb8d46c9a92798c5c091935`. [The public proof artifact](https://github.com/openclaw/openclaw/actions/runs/34473103003/artifacts/10150867398) includes the complete observations and screenshot. The existing no-override control also passed. - `405bd88f4e0ec605a067b2b7172f5b8416e259c3` separates the recorder's two event registrations to fix the generated TypeScript overload error. Its production code, scenario actions, filtering and assertions are unchanged. [Required CI](https://github.com/openclaw/openclaw/actions/runs/34475274851) checks that exact corrected head. ## Limits and preserved behavior The real-Gateway case proves admission, readback and visible lifecycle behavior. Its unchanged `/think` reader does not independently demonstrate the hidden selector descriptor repair. That distinction is covered by the original source assertions and remains for code-aware review. The observed complete identities do not establish a universal impossibility of partial inputs. Earlier Chromium evidence used a maintained synthetic Gateway. Its two reporter emissions are one 34-request case; the prior independent acceptance remains limited to those synthetic observations. All three earlier blocked local reviews, the bounded native lint failure, the public scan deadline, the corrected type error and earlier Chromium connection timeout remain retained. The owner's new internal-refactor approval changes the next review input; it does not edit or reuse an earlier verdict. Fresh exact-head review is required. Current CI passes type checking and the real-Gateway browser job; its remaining docs-navigation and managed-child tooling failures require causal disposition before landing. Complete identities, matching runtime profiles, inherited choices, unknown-support server validation, draft reconciliation and Fast reset retain their current contracts. Native profile producers and provider-login work remain separate. Co-authored-by: Ayaan Zaidi <[email protected]>
Related: #136257.
What Problem This Solves
Preserves a saved Off thinking override when switching to a model with no thinking choices. The internal selector could also combine a partial model identity with unrelated defaults.
Why This Change Was Made
Keep model and provider together during profile resolution and forward the same target from New Session. Preserve saved Off in an empty-profile descriptor without adding a slider or implicit setting write.
User Impact
An unsupported thinking profile keeps the saved Off value visible and rejects unsupported changes. Partial-identity cleanup is an internal refactor; no reachable partial-identity defect is claimed.
Consumers: shared thinking selection and New Session use one complete model target.
Evidence
Four selector/consumer regressions failed before the change; 28 affected cases passed. A real Gateway/browser lifecycle saved Off, changed to a model with no choices, displayed Off with no options and refused High without changing state. That visible lifecycle does not independently prove the hidden descriptor change; focused source assertions cover it.