Skip to content

fix: keep thinking choices tied to the selected model - #142822

Merged
obviyus merged 4 commits into
mainfrom
fix/thinking-ui-profile-identity
Sep 10, 2026
Merged

obviyus merged 4 commits into
mainfrom
fix/thinking-ui-profile-identity

Conversation

@obviyus

@obviyus obviyus commented Sep 9, 2026 •

Copy link
Copy Markdown
Collaborator

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.

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.
@obviyus obviyus self-assigned this Sep 9, 2026
@clawsweeper

clawsweeper Bot commented Sep 9, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added app: web-ui App: web-ui size: M maintainer Maintainer-authored PR labels Sep 9, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 9, 2026
@clawsweeper

clawsweeper Bot commented Sep 9, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 10, 2026, 8:51 AM ET / 12:51 UTC (Revision 6).

ClawSweeper review

What this changes

The 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
Reviewed head: 405bd88f4e0ec605a067b2b7172f5b8416e259c3

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused shared-owner repair with relevant lifecycle evidence and no blocking findings; ordinary CI requirements still apply.
Proof confidence 🐚 platinum hermit (4/6) ✨ media proof bonus Sufficient (linked_artifact): Retained real Gateway/browser evidence exercises saving Off and switching to an empty-profile model, with preserved readback, High refusal, and no unintended thinking write; the exact-head real-Gateway job also passed. Selector assertions cover the hidden descriptor repair, while partial identities remain internal invariant coverage. Artifact payload inspection was environment-blocked, so no fresh screenshot or full-trace inspection is claimed.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (linked_artifact): Retained real Gateway/browser evidence exercises saving Off and switching to an empty-profile model, with preserved readback, High refusal, and no unintended thinking write; the exact-head real-Gateway job also passed. Selector assertions cover the hidden descriptor repair, while partial identities remain internal invariant coverage. Artifact payload inspection was environment-blocked, so no fresh screenshot or full-trace inspection is claimed.
Evidence reviewed 8 items Current main still needs the repair: Fetched main independently fills missing model/provider fields from defaults and suppresses saved Off whenever the displayed choices are empty. New Session also retains the mixed fallback. These are the specific behaviors changed by the introduced production hunks.
Established selection contract: The documented web-chat contract distinguishes explicit overrides from inheritance and assigns supported thinking choices to Gateway metadata. The patch preserves the existing non-reasoning Off-only exception without adding a setting write.
Consumer and regression coverage: The selector retains an unanchored Off override for empty profiles. The command consumer rejects explicitly unsupported levels but leaves unknown support to server validation. Added selector, command, draft, and browser cases exercise these distinctions; no tests were executed during this read-only review.
Findings None None.
Security None None.

How this fits together

The 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]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source -6, Tests +338. Total +332 across 7 files.

View PR surface stats
Area Files Added Removed Net
Source 2 12 18 -6
Tests 5 339 1 +338
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 7 351 19 +332

Review metrics

Metric Value Why it matters
Production versus regression coverage Production −6 lines; tests +338 lines Production shrinks while the added coverage separates selector invariants, consumer behavior, and real-Gateway lifecycle preservation.

Technical review

Best 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.

Labels

Label justifications:

  • P2: This is a bounded Control UI selection repair with no demonstrated urgent runtime outage.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (linked_artifact): Retained real Gateway/browser evidence exercises saving Off and switching to an empty-profile model, with preserved readback, High refusal, and no unintended thinking write; the exact-head real-Gateway job also passed. Selector assertions cover the hidden descriptor repair, while partial identities remain internal invariant coverage. Artifact payload inspection was environment-blocked, so no fresh screenshot or full-trace inspection is claimed.
  • proof: sufficient: Contributor real behavior proof is sufficient. Retained real Gateway/browser evidence exercises saving Off and switching to an empty-profile model, with preserved readback, High refusal, and no unintended thinking write; the exact-head real-Gateway job also passed. Selector assertions cover the hidden descriptor repair, while partial identities remain internal invariant coverage. Artifact payload inspection was environment-blocked, so no fresh screenshot or full-trace inspection is claimed.

Evidence

What I checked:

  • Current main still needs the repair: Fetched main independently fills missing model/provider fields from defaults and suppresses saved Off whenever the displayed choices are empty. New Session also retains the mixed fallback. These are the specific behaviors changed by the introduced production hunks. (ui/src/lib/chat/thinking.ts:52, f41b7696c876)
  • Established selection contract: The documented web-chat contract distinguishes explicit overrides from inheritance and assigns supported thinking choices to Gateway metadata. The patch preserves the existing non-reasoning Off-only exception without adding a setting write. Public docs: docs/tools/thinking.md. (docs/tools/thinking.md:136, 405bd88f4e0e)
  • Consumer and regression coverage: The selector retains an unanchored Off override for empty profiles. The command consumer rejects explicitly unsupported levels but leaves unknown support to server validation. Added selector, command, draft, and browser cases exercise these distinctions; no tests were executed during this read-only review. (ui/src/lib/chat/thinking.ts:244, 405bd88f4e0e)
  • Related merged work and routing history: GitHub verifies fix(ui): stop guessing model thinking capabilities #142646 merged as 52f445a. Its profile consolidation is related groundwork, not a replacement for this remaining repair. Current-main history also identifies earlier catalog maintenance by Ayaan Zaidi and Peter Steinberger. (ui/src/pages/new-session/model-control.ts, 52f445a0b104)
  • Latest release comparison: The v2026.9.3 source likewise contains independent identity fallback and the empty-choice Off suppression. The requested repair is therefore not established as shipped. (ui/src/lib/chat/thinking.ts:288, 1391f7cd2d40)
  • Real-Gateway proof and exact-head continuity: The supplied body records a real Gateway/browser model switch retaining saved Off, reporting no choices, refusing High, and making only the intended model patch. GitHub confirms the real-Gateway job passed at the reviewed head. The preceding commit's proof remains applicable: GitHub's commit patch confirms the final change only separates typed WebSocket recorder registrations. The unchanged /think reader demonstrates lifecycle preservation; selector-state assertions separately cover the descriptor repair. (ui/src/e2e/chat-thinking-metadata.real-gateway.e2e.test.ts:74, 405bd88f4e0e)

Likely related people:

  • unknown: The claimed source-line change could not be verified from bounded local history. (role: source history unknown; confidence: low)
  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

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 (5 earlier review cycles)
  • reviewed 2026-09-09T04:19:14.488Z sha 4e5d605 :: blocked before merge. :: none
  • reviewed 2026-09-09T04:45:58.817Z sha 1750451 :: blocked before merge. :: none
  • reviewed 2026-09-09T05:16:04.122Z sha 1750451 :: needs maintainer review before merge. :: none
  • reviewed 2026-09-10T11:51:02.288Z sha f5a9412 :: needs maintainer review before merge. :: none
  • reviewed 2026-09-10T12:20:56.897Z sha 405bd88 :: blocked before merge. :: none

@obviyus obviyus closed this Sep 10, 2026
@obviyus obviyus reopened this Sep 10, 2026
@clawsweeper clawsweeper Bot added the proof: sufficient ClawSweeper judged the real behavior proof convincing. label Sep 10, 2026
@obviyus

obviyus commented Sep 10, 2026

Copy link
Copy Markdown
Collaborator Author

landpr-approve-unrelated-red
pr: 142822
head: 405bd88
run: 34475274851 attempt: 1
failed: checks-node-compact-small-26 job=102864631975 conclusion=failure
failed: checks-node-compact-small-31 job=102864631962 conclusion=failure
check: openclaw/ci-gate

@obviyus
obviyus merged commit c973fe7 into main Sep 10, 2026
135 of 138 checks passed
@obviyus
obviyus deleted the fix/thinking-ui-profile-identity branch September 10, 2026 13:15
@obviyus

obviyus commented Sep 10, 2026

Copy link
Copy Markdown
Collaborator Author

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.

  • Bug/contract: An empty profile lost its saved Off descriptor; the internal partial-identity input could borrow a missing field from defaults.
  • Fix: Keep one model/provider target and preserve the saved override descriptor independently of available choices; remove the mixed-identity helper.
  • Validation: Four baseline source/consumer failures,28affected passes, three fresh independently accepted public clauses and a clean exact-head local review. Current typecheck and real-Gateway CI jobs passed.

Landed using the standing unrelated-CI exception for completed run34475274851/attempt1:

Failure Causal disposition
docs-sync navigation assertion, job102864631962 PR143977/c0b128 moved dependency-locking into Release & CI without updating the literal test expectation. The route and assertion are unchanged from testedmain parent3a135210.
managed-child zombie-reaping fixture, job102864631975 The fresh constant TS child and unchanged tooling supervisor fail before any UI code is involved. Cleanup reports an initially surviving group, then successful reaping. Precise scheduling cause and introducing commit remain unestablished.

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.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 11, 2026
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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: web-ui App: web-ui maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: M status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant