Skip to content

improve(ui): edit model and reasoning while replies run - #160440

Merged
roboclaw-bot merged 4 commits into
mainfrom
openclaw/live-model-effort-preferences
Oct 10, 2026
Merged

roboclaw-bot merged 4 commits into
mainfrom
openclaw/live-model-effort-preferences

Conversation

@roboclaw-bot

@roboclaw-bot roboclaw-bot commented Sep 28, 2026 •

Copy link
Copy Markdown
Collaborator

Closes #160428

What Problem This Solves

The Control UI prevents users from choosing a model or reasoning effort while a reply is in progress, even when they only want to change the preference for waiting work.

User Impact

Users with existing write access can change model and reasoning preferences during sending, preparation, and streaming. The selector displays the chosen preference immediately, with no next-turn badge or toast. Already admitted turns keep their settings; ordinary waiting messages use the latest successfully saved preference, preserving explicit-turn thinking overrides.

Model-switch-in-progress, offline/backend, sharing/role, model-validation, rollback, and stale-navigation/reconnect protections remain. Fast, account, and context-window controls retain their existing busy guards. No native-app or administrator-policy changes.

Maintainer direction: @steipete has requested this busy-time model/reasoning preference behavior and authorized repair and landing. Current-main conflicts are resolved; repaired queued-selection races are covered by regression tests. No deployment is included.

Why This Change Was Made

This deliberately changes the previous busy-state UX policy; it does not hot-switch an executing model call. The preference selector no longer borrows its label from an active/fallback execution. The now-unused selector-only observation cache is removed; recorded execution metadata is unchanged.

Thinking-only patches now refresh waiting work without rebinding its model/account or clearing fallback provenance. Queued selection is copied at the admission owner's writer fence—not before waiting or after source adoption—so a concurrent committed preference is included, but later edits cannot change the admitted turn or its lifecycle bindings.

Evidence

  • Final-head CI passed: run 38022861806, head 31892600062dfd9ee4a16f736d7591947978bef9.

  • Red/green regressions for sending/preparing/streaming controls, denied states, and thinking-only queue updates.

  • Real sessions.patch, storage, queue drain, and admission tests: A stays on X; waiting B/C follow Y; after B is admitted, Z changes only C. Deterministic barriers reproduce and fix the pre-admission stale-copy race and check the post-admission boundary.

  • Explicit thinking/default precedence, rejected patches, queued route/auth/fallback preservation, model-switch consistency, settings/send ordering, rollback, stale ownership, and retained execution metadata are covered.

  • Fresh Codex autoreview through P2: scoped-clean after resolving the admission race.

  • Actual baseline and candidate production UI builds, matched light theme and 1200 × 853 viewport, with synthetic public-safe models/content. Screenshots use a deterministic mock Gateway, not paid/live inference. The interaction proof saves model and effort while the same reply continues; no abort or replacement send occurs.

Current-main repair: queued fallback probes now retain their admission-fenced model/account through execution, and thinking-only /think commands refresh waiting work without rebinding its route. The bundled browser E2E now passes (1.73 s test time; 29.06 s including build/startup), closing the earlier loopback-preflight gap. Backend boundary tests: 240 passed across 11 files (166.53 s wall including 35.54 s shared compilation). Updated UI coverage: 229 passed across four files; the final two changed test files passed 178 tests in 12.27 s wall. P0–P2 autoreview of repaired production head 77d63d665c4b is scoped-clean; later commits only align inspected test expectations with this approved behavior. The inherited catalog browser expectations were updated for this intentional display-policy change: both affected browser files now pass all 13 cases (87.66 s including build/compiler startup; desktop/mobile fallback cases 2.67/2.34 s). The remaining runtime-label and mounted-pane expectations were aligned too: 34 cases passed in 12.63 s, with execution-metadata and reentrant-event assertions retained. Core/UI types, all selected test type graphs across completed runs, and changed-file lint pass. One full local check stopped on an intermittent native TypeScript compiler nil-pointer panic in the agents-sessions graph; a scoped repeat passed without source changes. The compiler cause is unresolved, and no single all-green full local gate, live-provider, or full-suite pass is claimed.

The before/after images below are the original PR’s inspected synthetic production-bundle captures; current-main behavior was reverified by the bundled browser test.

Before

Before: model and effort controls are disabled while the reply streams

After

After: Example B is selected in the model menu while the same reply continues

Original-head focused checks and test cost (before current-main integration)
  • UI: 430 focused tests passed across rendering, history, control, settings/send, ownership, and policy suites. The final changed UI files were rerun individually: 340 chat-view tests (7.70 s wall), 2 pane/model event tests (3.40 s), 40 in-flight history tests (2.63 s), and 7 preference-control cases (2.15 s).
  • Backend: 10 real patch/queued-admission cases, 36 follow-up admission cases, 5 persistent-store admission cases, 29 queue-state cases, and 10 scope/model-policy cases passed. The patch/admission file took 7.95 s in a warm targeted run; the final cold run took 56.94 s, including 45.11 s of shared worker compilation. CI timings are not yet available.
  • Repository wrappers used: node scripts/run-vitest.mjs <files> --maxWorkers=1, node scripts/run-tsgo.mjs, node scripts/run-oxlint.mjs, and the changed-check planner.
  • Core and UI types, all 26 test type graphs, format, line-cap/max-lines/assertion guards, i18n, dependency/config/plugin guards, and dead-export scans passed before the final narrow admission refinement. Affected core, Gateway, messaging, and browser test types were rechecked as the admission repair was finalized, followed by clean changed-file lint/style checks. Initial task-caused lint findings were fixed without suppressions or baseline edits.
  • Baseline source: e433bfda89c486f98dfb03586dacd1e23b6f820b. Media and local proof files are not committed.

Worked on by

Work sessions


View the OpenClaw team session

@clawsweeper

clawsweeper Bot commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

ClawSweeper review in progress

ClawSweeper is reviewing this revision. This supersedes any previous blocked status.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation app: web-ui App: web-ui gateway Gateway runtime size: L labels Sep 28, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. 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 28, 2026
@clawsweeper

clawsweeper Bot commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR lets users change model and reasoning preferences during replies while preserving settings already assigned to admitted turns.

Example: A reply uses Example A while another message waits, and the user selects Example B with High reasoning.

  • Before: The controls are disabled until the reply finishes.
  • After: The preference saves immediately; the running reply retains Example A, and waiting work receives Example B with High reasoning at admission.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) Useful, approved behavior with inspected visual evidence and meaningful owner-boundary coverage; backend evidence remains harness-based and exact-head CI is unfinished.
Proof confidence 🐚 platinum hermit (4/6) This collaborator-authored PR is outside the external-contributor proof gate; inspected production-bundle screenshots demonstrate busy-time selection, while real patch/storage/admission tests support queued-turn isolation and the reported browser run covers continued streaming.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Preference · Worth it: Yes · Fix scope: Complete
User problem: Users must wait for or interrupt a reply before choosing model and reasoning preferences for waiting work.
Reason: The collaborator-authored direction explicitly approves this policy change, and the implementation preserves existing permissions, active-turn settings, and guarded adjacent controls.

Merge readiness

✅ Ready for maintainer review

Keep this PR open: it delivers an approved preference change that current main still lacks, and the repaired head has no actionable findings. The earlier conflict and draft blockers are cleared; exact-head CI remains pending.

Priority: P2
Reviewed head: 77d63d665c4b159d11e9ca3329b015c766bd2924

Before merge

None.

Findings

None.

Agent review details

How this fits together

Control UI selections enter the existing session-patch owner, which persists preferences and refreshes waiting work; reply admission captures each turn's selection before execution.

flowchart LR
  A[Model and reasoning controls] --> B[Session patch owner]
  B --> C[Stored session preferences]
  B --> D[Waiting followup queue]
  D --> E[Reply admission owner]
  E --> F[Agent execution]
Loading

Technical review

Best possible solution:

Keep preference changes in the existing session-patch owner and freeze waiting work’s model, account, and reasoning selection at admission.

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

The busy-state restriction is intentional behavior visible on current main and in the before screenshot; this PR changes that policy rather than repairing an established bug contract.

Is this the best way to solve the issue?

The implementation reuses session mutation ordering and reply admission, removes the superseded selector cache, and isolates admitted turns from subsequent preference edits.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against bc524d890300.

Provenance checked

  • Preference selector versus observed execution label changes intended behavior with a stated reason (33aee1b: Show the model actually producing the response, including fallback and reload recovery.)
  • Queued model and thinking publication keeps the original intent (622b91d: Retarget waiting work without interrupting the active run.)
  • Session-patch queued selection refresh keeps the original intent (b46c38c: Keep queued selection consistent with committed model/runtime choices.)
  • Execution-time primary-probe recheck changes intended behavior with a stated reason (c8782d1: Recheck auto-fallback probes against concurrent selection changes before execution.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit b46c38c adds src/gateway/server-methods/sessions-patch-model-selection.ts:67 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: b46c38cfa732; files: src/gateway/server-methods/sessions-patch-model-selection.ts)

PR surface

Source -49, Tests +794, Docs +8. Total +753 across 22 files. Added test files: 2.

View PR surface stats
Area Files Added Removed Net
Source 13 93 142 -49
Tests 7 902 108 +794
Docs 2 14 6 +8
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 22 1009 256 +753

Review metrics

Metric Value Why it matters
Production versus test changes Production +93/−142 LOC; tests +902/−108 LOC Production shrinks by removing selector-only observation state; most added coverage exercises the real patch/admission race and browser interaction.

Labels

Label changes:

  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • remove status: ⏳ waiting on author: Current PR status label is status: 👀 ready for maintainer look.

Label justifications:

  • P2: This is a bounded chat ergonomics improvement with preserved active-turn behavior.
  • 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.
  • proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only; repair and merge need explicit maintainer commands such as @clawsweeper autofix or @clawsweeper automerge.

History

Review history (2 earlier review cycles)
  • reviewed 2026-09-28T12:22:03.158Z sha c37cd03 :: blocked before merge. :: none
  • reviewed 2026-10-10T03:31:01.231Z sha c37cd03 :: needs changes before merge. :: none

Reviewed October 9, 2026, 11:50 PM ET / October 10, 2026, 03:50 UTC (Revision 3).

@clawsweeper clawsweeper Bot added status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Oct 10, 2026
Integrate current main while preserving the existing contribution. Keep queued fallback probes bound to admission and publish thinking-only directive changes without interrupting the active reply.

Co-authored-by: hxy91819 <[email protected]>

Co-authored-by: steipete <[email protected]>
@roboclaw-bot

Copy link
Copy Markdown
Collaborator Author

@clawsweeper re-review the repaired head 77d63d6. Current-main conflicts are resolved, queued fallback probes retain the admitted selection through execution, and thinking-only directives refresh waiting turns. Peter has explicitly authorized this behavior and landing; focused backend/UI and bundled-browser boundary proof pass.

@clawsweeper

clawsweeper Bot commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@roboclaw-bot
roboclaw-bot marked this pull request as ready for review October 10, 2026 03:45
@clawsweeper clawsweeper Bot added status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Oct 10, 2026
Update desktop and mobile browser expectations for the approved preference selector policy. Both browser suites pass all 13 cases, including fallback, reload, and recovery.

Co-authored-by: steipete <[email protected]>

Co-authored-by: hxy91819 <[email protected]>
@roboclaw-bot
roboclaw-bot enabled auto-merge (squash) October 10, 2026 04:00
@roboclaw-bot
roboclaw-bot disabled auto-merge October 10, 2026 04:04
Align remaining runtime and mounted-pane assertions with the approved saved-preference display. Retain independent execution-metadata assertions and reentrant event coverage; all 34 cases pass.

Co-authored-by: steipete <[email protected]>

Co-authored-by: hxy91819 <[email protected]>
@roboclaw-bot
roboclaw-bot merged commit f499f82 into main Oct 10, 2026
138 checks passed
@roboclaw-bot
roboclaw-bot deleted the openclaw/live-model-effort-preferences branch October 10, 2026 04:17
@roboclaw-bot

Copy link
Copy Markdown
Collaborator Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 10, 2026
)

* improve(ui): edit model and reasoning while replies run

Co-authored-by: hxy91819 <[email protected]>

* test: keep saved model preference visible through fallback

Update desktop and mobile browser expectations for the approved preference selector policy. Both browser suites pass all 13 cases, including fallback, reload, and recovery.

Co-authored-by: steipete <[email protected]>

Co-authored-by: hxy91819 <[email protected]>

* test: preserve preference labels across observed runtime events

Align remaining runtime and mounted-pane assertions with the approved saved-preference display. Retain independent execution-metadata assertions and reentrant event coverage; all 34 cases pass.

Co-authored-by: steipete <[email protected]>

Co-authored-by: hxy91819 <[email protected]>

---------

Co-authored-by: hxy91819 <[email protected]>
Co-authored-by: steipete <[email protected]>
RomneyDa added a commit that referenced this pull request Oct 12, 2026
… switch model (#160440) (extracted hotfix)

Original subject: improve(ui): edit model and reasoning while replies run
(#160440).

Extracted from #160440 (f499f82): took only the one-line
src/auto-reply/reply/queue/state.ts fix that deletes
run.autoFallbackPrimaryProbe beside hasAutoFallbackProvenance when
refreshQueuedFollowupSession rewrites the model selection. On the branch,
after /model on a session running on an auto-fallback model, a queued
follow-up kept its primary-probe record and could run on the old model.
Extended the existing state.test.ts retarget case to cover the probe. Left
out the Control UI live model/reasoning editing feature, admission changes,
and the sessions.patch rework: they are feature work.

Extracted-from: f499f82
Co-authored-by: hxy91819 <[email protected]>
Co-authored-by: steipete <[email protected]>
RomneyDa added a commit that referenced this pull request Oct 12, 2026
Release provenance: 89329f6 -> #168587
Release provenance: e6a9022 -> #168905
Release provenance: 15f3f12 -> #162266
Release provenance: 20805b8 -> #169430
Release provenance: 568fec8 -> #169102
Release provenance: 39dba6d -> #160440
Release provenance: 5df28c7 -> #168393
Release provenance: 10bcd8e -> #168164
Release provenance: dc5f1f5 -> #168446
Release provenance: 9f1e441 -> #168044
Release provenance: 5a235fc -> #168651
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 docs Improvements or additions to documentation gateway Gateway runtime P2 Normal backlog priority with limited blast radius. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: XL 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.

Control UI: edit model and reasoning preferences while replies run

2 participants