Skip to content

fix(ui): show model changes only after sending a message - #184702

Merged
vyctorbrzezowski merged 3 commits into
mainfrom
brzezowski/model-change-on-send
Oct 26, 2026
Merged

vyctorbrzezowski merged 3 commits into
mainfrom
brzezowski/model-change-on-send

Conversation

@vyctorbrzezowski

@vyctorbrzezowski vyctorbrzezowski commented Oct 26, 2026 •

Copy link
Copy Markdown
Member

What Problem This Solves

Choosing a model immediately added a chat entry, even when the choice was abandoned before sending. The entry rendered as a System bubble, and confirmation could repeat the model name and alias.

User Impact

Model changes appear as the existing horizontal notice with the next submitted message. Returning to the original model before sending adds no notice. Confirmation shows the model name once.

Why This Change Was Made

The selected model is captured by the existing accepted-input persistence path. A session baseline survives draft picker edits and advances with the accepted user-message commit, including for existing conversations. Chat compares submitted selections, keeps automatic fallback and supplemental media separate, and preserves safe display fields for previously recorded notices. Ordinary notices render synchronously at their real height, avoiding the loading placeholder and subsequent contraction.

Follow-up to #182742.

Evidence

Focused backend, notice, and model-picker suites pass, including a real sessions.patch → chat.send regression with pre-change history. Core/UI types, scoped lint, formatting, and the production UI build pass. Independent Codex review found no actionable P0–P2 issues.

Risk and coverage: Browser proof uses the real Control UI and display sanitizer with synthetic data and mocked Gateway transport. Backend tests exercise queued and committed inputs across durable and in-memory sessions. No live model invocation is claimed. A history page without a known preceding selection does not infer a transition.

Confirmation

Before After
Repeated name and alias Single model name

Previously recorded notice

Before After
System bubble Restored horizontal notice
Submitted message in context

Notice with the submitted message

The 49-second recording runs at normal speed, with pauses to read each model choice and the notice after sending. The accepted notice enters once without a loading placeholder or a later height contraction.

model-change-stable.mp4

Keep model choices out of chat history until an input is sent, preserve the horizontal notice design, and avoid repeating model aliases in confirmation.
@clawsweeper

clawsweeper Bot commented Oct 26, 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 docs Improvements or additions to documentation app: web-ui App: web-ui gateway Gateway runtime size: M labels Oct 26, 2026
@vyctorbrzezowski
vyctorbrzezowski marked this pull request as ready for review October 26, 2026 14:10
@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. P2 Normal backlog priority with limited blast radius. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. 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 clawsweeper:intake:bug Preliminary submission classification; full source review pending. labels Oct 26, 2026
@clawsweeper

clawsweeper Bot commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge.

What this changes

This PR records model changes with submitted messages, restores horizontal notices, and removes repeated model names from confirmation.

Example: Choose Demo model B, then return to Demo model A before sending.

  • Before: Both picker changes add history notices.
  • After: Sending with the original model adds no model-change notice.

Review scores

Measure Result What it means
Overall readiness 🦪 silver shellfish (2/6) Useful owner-based repair with inspected visual evidence, but an introduced static cycle blocks CI and persisted-state upgrade compatibility remains unproven.
Proof confidence 🦐 gold shrimp (3/6) This maintainer-authored PR is outside the ordinary contributor proof gate; inspected screenshots demonstrate confirmation and divider presentation with mocked Gateway transport, while backend behavior has reported owner-harness coverage. The newer recording could not be retrieved because scratch writes failed and browser retrieval returned Cache miss; this infrastructure limit is not contributor work. The author must still supply latest-stable upgrade evidence for persisted selection metadata, preserving existing messages and model preferences.
Patch quality 🦪 silver shellfish (2/6) 1 actionable review finding remain.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Abandoned model choices clutter conversation history, confirmation repeats model names, and saved notices appear as System bubbles.
Reason: Maintainer authorship establishes direction, and recording submitted choices gives conversation history a clearer meaning.

Merge readiness

⛔ Blocked before merge - 2 items remain

Keep this useful maintainer-authored PR open: the previous finding is resolved, but the latest rendering change introduces a static import cycle that blocks the architecture check.

Priority: P2
Reviewed head: 46e6c8deedd1b6f1c418e214bc5803978b700cf7

Before merge

  • Remove the reverse props import before eagerly loading notices (P2) - This static import creates chat-notice-view.tsx → chat-divider.tsx → chat-notice-view.tsx, because the divider imports ChatNoticeProps back from this module. The repository's Madge checker includes type-only static imports, so this cycle fails the required architecture check; current-head annotations report madge-import-cycles failed. Move ChatNoticeProps into the divider module and import it alongside ChatNoticeDetails here, removing the reverse import, so ordinary notices can remain synchronous.
  • Add data-model compatibility proof - The review found that existing stored data may not work after upgrade. Show that existing data still loads and works with this change.

Findings

  • [P2] Remove the reverse props import before eagerly loading notices — ui/src/pages/chat/components/chat-notice-view.tsx:3

Tests

  • Missing end-to-end proof: The author reports a red-before/green-after composed regression, but no latest-stable upgrade run demonstrates preserved conversation data and model preferences.
Agent review details

How this fits together

The Control UI patches session preferences through the Gateway; accepted user messages persist selection metadata, which chat history projects into model-change notices.

flowchart LR
  A[Model picker] --> B[Session preference owner]
  B --> C[Accepted input recorder]
  C --> D[Session and transcript storage]
  D --> E[Chat history projection]
  E --> F[Horizontal notice]
Loading

Technical review

Best possible solution:

Preserve accepted-input ownership and synchronous notices, move their shared props contract out of the reverse import, and verify existing-state upgrades.

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

Current-main source appends a notice during sessions.patch before any message is sent, and inspected before images show the repeated confirmation names and System bubble.

Is this the best way to solve the issue?

The existing session and accepted-input owners are appropriate, and the prior baseline defect is repaired; the eager rendering import needs a one-directional props contract.

Full review comments:

  • [P2] Remove the reverse props import before eagerly loading notices — ui/src/pages/chat/components/chat-notice-view.tsx:3
    This static import creates chat-notice-view.tsx → chat-divider.tsx → chat-notice-view.tsx, because the divider imports ChatNoticeProps back from this module. The repository's Madge checker includes type-only static imports, so this cycle fails the required architecture check; current-head annotations report madge-import-cycles failed. Move ChatNoticeProps into the divider module and import it alongside ChatNoticeDetails here, removing the reverse import, so ordinary notices can remain synchronous.
    Confidence: 0.99

Overall correctness: patch is incorrect
Overall confidence: 0.97

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Immediate model-change recording and confirmation changes intended behavior with a stated reason (feat: record model changes in chat #182742: Record accepted model changes outside model context and confirm non-local switches; this PR explicitly delays recording until submission and removes repeated display labels.)
  • Notice rendering and cached-row completeness changes intended behavior with a stated reason (perf(control-ui): restore cached transcript row facts together #184334: Restore cached row facts together while keeping ordinary notice details lazy; this PR makes ordinary notices synchronous to avoid placeholders and height contraction while retaining lazy interactive cards.)
  • Accepted-input persistence keeps the original intent (fix(gateway): preserve Control UI turns across restarts #106151: Commit accepted user input and recovery state atomically through the existing transcript owner; submitted-model bookkeeping joins that transaction.)
  • Custom-message detail sanitization keeps the original intent (3b2c61d0e2c2baa423e9a40d36d34c10e729667: Keep raw report diagnostics private while projecting narrowly selected presentation fields; the patch retains that approach for model-change from/to strings.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

Acceptance criteria:

  • pnpm check:madge-import-cycles
  • pnpm tsgo:ui
  • pnpm test ui/src/pages/chat/chat-system-notice.test.ts --maxWorkers=1
  • git diff --check

What I checked:

PR surface

Source +123, Tests +166, Docs 0. Total +289 across 22 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 16 223 100 +123
Tests 5 200 34 +166
Docs 1 1 1 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 22 424 135 +289

Review metrics

Metric Value Why it matters
Persistent metadata additions 1 session field and 1 user-message metadata field lastSubmittedModel preserves the baseline across picker edits; modelSelection records the submitted choice without adding a table or config option.

Labels

Label changes:

  • add rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦐 gold shrimp and patch quality is 🦪 silver shellfish.
  • remove rating: 🦐 gold shrimp: Current PR rating is rating: 🦪 silver shellfish, so this older rating label is no longer current.

Label justifications:

  • P2: This is a bounded conversation-history and confirmation improvement with a focused architecture-check repair.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦐 gold shrimp and patch quality is 🦪 silver shellfish.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.
  • 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 execution lanes are retired.

History

Review history (1 earlier review cycle)
  • reviewed 2026-10-26T14:29:07.254Z sha b73de6c :: blocked before merge. :: [P2] Preserve the previous selection for existing conversations

Reviewed October 26, 2026, 1:37 PM ET / 17:37 UTC (Revision 2).

@openclaw-barnacle openclaw-barnacle Bot added agents Agent runtime and tooling size: L and removed size: M labels Oct 26, 2026
@vyctorbrzezowski

Copy link
Copy Markdown
Member Author

Addressed in 46e6c8d. The existing session owner now retains the submitted-model baseline across picker edits and advances it in the accepted user-message transaction. The composed sessions.patch → chat.send regression uses pre-change history; it fails on b73de6c and passes with the fix. The focused backend suites pass all 64 cases.

The updated 49-second video also shows the notice entering without a loading placeholder or a subsequent height contraction.

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Oct 26, 2026
@vyctorbrzezowski
vyctorbrzezowski enabled auto-merge (squash) October 26, 2026 18:55
@vyctorbrzezowski
vyctorbrzezowski merged commit 27b94d4 into main Oct 26, 2026
123 of 127 checks passed
@vyctorbrzezowski
vyctorbrzezowski deleted the brzezowski/model-change-on-send branch October 26, 2026 20:08
@vyctorbrzezowski

Copy link
Copy Markdown
Member Author

Merged via explicitly authorized admin squash with attributed pre-existing CI failures.

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

* fix(ui): show model changes only after sending a message

Keep model choices out of chat history until an input is sent, preserve the horizontal notice design, and avoid repeating model aliases in confirmation.

* fix(chat): stabilize submitted model-change notices

* fix(chat): correct notice imports and fallback fixture
steipete added a commit that referenced this pull request Oct 30, 2026
Skip the native transcript metadata SELECT when the compressed frame, prepared report, and encoder-derived minimum cannot satisfy the existing savings threshold. Preserve byte-identical transcript/provider data, model-selection facts, restart delivery, and PostgreSQL behavior.

Addresses the redundant payload work from #185730 and #184702. Synthetic Gateway proof reduces ordinary warm turns from 48 to 45 SQL statements, with 13 worker requests and zero MAIN SQL unchanged; all fourteen turns and restart flows pass. The first sealed-history fingerprint from #186046 remains required.

Validated with payload and prompt-prefix tests, 48 byte-equivalent variants, two isolated code reviews plus a type-correction delta review, and exact-head CI/PostgreSQL conformance.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 31, 2026
…aw#188655)

Skip the native transcript metadata SELECT when the compressed frame, prepared report, and encoder-derived minimum cannot satisfy the existing savings threshold. Preserve byte-identical transcript/provider data, model-selection facts, restart delivery, and PostgreSQL behavior.

Addresses the redundant payload work from openclaw#185730 and openclaw#184702. Synthetic Gateway proof reduces ordinary warm turns from 48 to 45 SQL statements, with 13 worker requests and zero MAIN SQL unchanged; all fourteen turns and restart flows pass. The first sealed-history fingerprint from openclaw#186046 remains required.

Validated with payload and prompt-prefix tests, 48 byte-equivalent variants, two isolated code reviews plus a type-correction delta review, and exact-head CI/PostgreSQL conformance.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling 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: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. size: L status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant