Skip to content

fix(ui): preserve queued corrections across navigation and updates - #149366

Merged
steipete merged 10 commits into
mainfrom
codex/qa-queued-edit-reload
Sep 16, 2026
Merged

steipete merged 10 commits into
mainfrom
codex/qa-queued-edit-reload

Conversation

@steipete

@steipete steipete commented Sep 15, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes: unsaved queued-message corrections disappear during automatic UI updates or when switching through enough conversations to evict their chat view.

User Impact

User impact: corrections stay available until saved or canceled, including in background conversations. Review edit returns to the correction-owning split when it blocks an update reload, including after leaving Chat for another page. Navigation remains available when several conversations have open edits. Explicit browser reloads still discard unsaved corrections.

Why This Change Was Made

The queued editor owns an in-memory correction while the original remains queued. Its existing document reload guard now protects that custody through update recovery. The retained-chat cache also skips views that own corrections; when every candidate is being edited, it temporarily adds a slot and prunes back to its normal limit as edits resolve. Surviving views keep their slots, so pruning does not remount them. No durable storage format or message-delivery policy changes.

Evidence

Ten Chromium cases pass: Save and Cancel after update recovery, ordinary cache eviction pressure, navigation with every retained view being edited, returning to the owning split pane, clearing a preview in another split that already cached the same conversation, keeping that split hidden on narrow screens, and returning from another page to the original correction-owning split. They verify preserved corrections and separate drafts, no premature chat send, recovery reload after resolution, and overflow pruning after Save/Cancel. 232 focused owner/handoff tests passed; the final cache/page run passed another 53 tests (24 overlap). These cover the ordinary three-view limit, stable surviving panes, disposal, and handoffs.

Both defects were reproduced on the original code. The navigation reproduction lost the correction with zero document reloads and submitted the original queued text. The repaired flow retains the correction and sends nothing before resolution.

Before/after navigation screenshots.

The browser proof uses Chromium, the existing mocked Gateway, and source-mode UI; it proves correction custody and reload admission, not successful loading of a newly deployed artifact. Scoped type-aware lint, formatting, and whitespace checks pass. Fresh independent P2 review found no actionable issues.

Update-recovery screenshots (previously verified in chat and this PR):

Before: update recovery reloads and discards the correction editor

After: Review edit returns to the preserved correction and draft

The followup also sorts the private-server E2E inventory to satisfy the CI ownership guard. The exact failing guard now passes. Before/after cross-page Review edit screenshots.

Shared CI prerequisite

This branch includes the existing test-only fix from #149423, which is now merged. It resolves the unrelated managed-update fixture line-limit failure without changing its assertions or production behavior. The exact extracted patch passed four Linux lifecycle cases and a fresh independent review; its proof is included in the green current-head CI below. The feature-specific changes above are unchanged.

Real-Gateway CI readiness repair

CI exposed a separate model-picker test race: an absent CLI-agent loading indicator was accepted before discovery had started. The test now observes the latest successful discovery response on the current connection and waits for bootstrap, agent readiness, and settled rendering before checking the existing strict no-notices assertion. No product behavior, retry count, timeout, or assertion was weakened.

A controlled delayed-bootstrap/discovery run reproduces the original exact loading-notice failure. The repaired test passes that same schedule and a normal real-Gateway run, covering both new and existing conversations; fresh independent review found no actionable issue. The earlier desktop-resize failure passed on the unchanged scoped retry. Current-head hosted CI is green as recorded below.

CI repair follow-up

The catalog refresh test waits for completed CLI discovery using its actual response and rendered state. The branch also incorporates main's final #149520 fixture consolidation: linked dependencies are initialized exactly once after checkout and before the Node recorder is installed. The earlier shared-fixture failure remains recorded; no extra setup call is retained in the feature diff.

The merge with main incorporates the revisioned composer handoff from #149364. Its queued-edit transfer remains the existing owner; the reload guard and retained-view cache consult the live owning state. Fresh independent review of the complete 17-file feature diff against that main found no actionable P0–P2 issue. After replacing the old external dependency links with task-local dependencies matching the lockfile, all ten browser cases, 281 focused custody/handoff tests, and twelve wrapper cases pass. All three affected UI typegraphs and scoped typed lint pass. An equivalent focus-guard simplification resolves the integration line limit; its 29 page cases and fresh independent review pass. The canonical fixture follow-up also passed fresh independent review. Current head 51bdb27343718de5ae815524c2ac319c40e653fc passed all 91 hosted checks in CI run 35047633552. Native review artifacts are validated for that exact head.

@clawsweeper

clawsweeper Bot commented Sep 15, 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.

@steipete
steipete marked this pull request as ready for review September 15, 2026 19:23
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. 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. labels Sep 15, 2026
@clawsweeper

clawsweeper Bot commented Sep 15, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 15, 2026, 11:10 PM ET / September 16, 2026, 03:10 UTC (Revision 7).

ClawSweeper review

What this changes

Preserves unsaved queued-message corrections across conversation navigation and automatic UI reloads, adds recovery navigation, and improves supporting test synchronization.

Merge readiness

✅ Ready for maintainer review

This PR remains useful: current main lacks correction-aware eviction and reload protection. The earlier split-navigation findings are resolved, and no blocking correctness defect was found.

Priority: P2
Reviewed head: 51bdb27343718de5ae815524c2ac319c40e653fc

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused owner-level repair with convincing browser evidence, resolved prior findings, and no identified blocking defect.
Proof confidence 🦞 diamond lobster (5/6) ✨ media proof bonus Sufficient (screenshot): Inspected Chromium before/after screenshots show the changed pane-retention and reload-guard behavior preserving the correction and separate draft. Supplied browser scenarios exercise navigation, save/cancel, split recovery, and reload admission through the actual UI with a mocked Gateway; they do not claim successful deployment of a new artifact.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (screenshot): Inspected Chromium before/after screenshots show the changed pane-retention and reload-guard behavior preserving the correction and separate draft. Supplied browser scenarios exercise navigation, save/cancel, split recovery, and reload admission through the actual UI with a mocked Gateway; they do not claim successful deployment of a new artifact.
Evidence reviewed 7 items Current main still needs the repair: At fetched main, the retained cache evicts its oldest entry without checking for an open correction; the state controller does not register a queued-edit reload guard. The merged split-draft repair does not supply these behaviors.
Correction retention and cleanup: The introduced cache changes skip correction-owning panes, permit temporary overflow, and prune released entries without moving surviving slots. The controller unregisters its reload guard during disposal.
Prior findings resolved: Review edit selects the owning split before navigation, including when Chat is retained behind another page. Preview cancellation restores the split whose presentation changed and respects narrow-screen visibility.
Findings None None.
Security None None.

How this fits together

The Control UI keeps queued corrections in their chat pane while the original message remains in the outbox. Pane retention and document reload admission determine whether that unsaved correction survives navigation or a Gateway update.

flowchart TD
  A[Queued message correction] --> B[Chat pane owns unsaved edit]
  C[Conversation navigation] --> D[Retained pane cache]
  B --> D
  B --> E[Document reload guard]
  F[Gateway update] --> E
  E --> G[Review edit in owning split]
  G --> H[Save or cancel]
  H --> D
  H --> E
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source +121, Tests +458, Docs +8. Total +587 across 18 files.

View PR surface stats
Area Files Added Removed Net
Source 10 144 23 +121
Tests 7 483 25 +458
Docs 1 8 0 +8
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 18 635 48 +587

Review metrics

Metric Value Why it matters
Production versus test growth Production net +121 lines; tests and test support net +458 lines Production growth supports correction retention and recovery navigation; the larger test delta exercises lifecycle and navigation regressions.

Technical review

Best possible solution:

Keep correction custody with the existing queued editor, retain its pane until resolution, and let the shared reload guard provide direct recovery navigation.

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

Yes: edit an offline queued message, then exceed the three-view cache or trigger update recovery. Current-main source supports both failure paths, and supplied before/after browser evidence demonstrates them; this review did not execute a reproduction.

Is this the best way to solve the issue?

Yes: the patch extends existing retention, navigation, and reload owners without introducing another correction store or changing durable message formats.

AGENTS.md: found and applied where relevant.

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

Labels

Label justifications:

  • P2: Repairs a bounded Control UI workflow that can discard unsaved queued corrections during navigation or automatic reload.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (screenshot): Inspected Chromium before/after screenshots show the changed pane-retention and reload-guard behavior preserving the correction and separate draft. Supplied browser scenarios exercise navigation, save/cancel, split recovery, and reload admission through the actual UI with a mocked Gateway; they do not claim successful deployment of a new artifact.
  • proof: sufficient: Contributor real behavior proof is sufficient. Inspected Chromium before/after screenshots show the changed pane-retention and reload-guard behavior preserving the correction and separate draft. Supplied browser scenarios exercise navigation, save/cancel, split recovery, and reload admission through the actual UI with a mocked Gateway; they do not claim successful deployment of a new artifact.
  • proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence. Inspected Chromium before/after screenshots show the changed pane-retention and reload-guard behavior preserving the correction and separate draft. Supplied browser scenarios exercise navigation, save/cancel, split recovery, and reload admission through the actual UI with a mocked Gateway; they do not claim successful deployment of a new artifact.

Evidence

What I checked:

  • Current main still needs the repair: At fetched main, the retained cache evicts its oldest entry without checking for an open correction; the state controller does not register a queued-edit reload guard. The merged split-draft repair does not supply these behaviors. (ui/src/pages/chat/chat-page-retained-sessions.ts:97, c1c870a41755)
  • Correction retention and cleanup: The introduced cache changes skip correction-owning panes, permit temporary overflow, and prune released entries without moving surviving slots. The controller unregisters its reload guard during disposal. (ui/src/pages/chat/chat-page-retained-sessions.ts:100, 51bdb2734371)
  • Prior findings resolved: Review edit selects the owning split before navigation, including when Chat is retained behind another page. Preview cancellation restores the split whose presentation changed and respects narrow-screen visibility. (ui/src/pages/chat/chat-pane-retained-presentation.ts:55, 51bdb2734371)
  • Inspected browser proof: Inspected all four prepared screenshots. The navigation pair visibly changes from submitted original text to a retained correction alongside the separate composer draft; the update pair shows the correction retained after recovery navigation. The captured body and fix(ui): preserve queued corrections across navigation and updates #149366 (comment) identify Chromium, source-mode UI, and a mocked Gateway. The supplied ten-case browser regression covers save/cancel, overflow pruning, split recovery, and zero premature sends. This establishes browser-side custody, not deployed-artifact replacement. (ui/src/e2e/chat-queue-update-reload.e2e.test.ts:18, 51bdb2734371)
  • Supporting test synchronization: The model-picker test now waits for the latest successful discovery response on the current socket and settled rendering before its unchanged empty-notices assertion. Wrapper fixture dependencies are initialized once after checkout and before installing the Node recorder. (ui/src/e2e/model-catalog-partial-refresh.real-gateway.e2e.test.ts:174, 51bdb2734371)
  • Area history and routing: Current-main history records Peter Steinberger's stable-slot and retained-pane work and Dallin Romney's queued-edit reconnect repair. Exact line attribution could not be completed because historical blobs were unavailable; routing candidates therefore have no introduction claim. (ui/src/pages/chat/queued-message-edit.ts:49, ee7f80857e0d)

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Dallin Romney: 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 (6 earlier review cycles)
  • reviewed 2026-09-15T19:51:03.748Z sha 567315b :: needs changes before merge. :: [P2] [P2] Activate the correction's owning split before navigating
  • reviewed 2026-09-15T20:12:06.490Z sha b188c865d6ef5660c835a02b761dd217c7154cf2 :: blocked before merge. :: [P2] [P2] Restore the owning split when Review edit starts outside Chat
  • reviewed 2026-09-15T21:03:59.436Z sha 13c9fc8 :: needs maintainer review before merge. :: none
  • reviewed 2026-09-15T21:44:39.203Z sha e9ef7c4 :: needs maintainer review before merge. :: none
  • reviewed 2026-09-16T00:29:47.289Z sha cb91593 :: needs maintainer review before merge. :: none
  • reviewed 2026-09-16T02:29:26.620Z sha 51bdb27 :: needs maintainer review before merge. :: none

@steipete

Copy link
Copy Markdown
Contributor Author

Expanded navigation regression: visiting three other conversations previously evicted the chat view that owned an unsaved queued-message correction. Returning showed the original text already submitted, with no document reload involved.

The repaired cache retains views with open corrections and releases temporary overflow when edits are saved or canceled. The matching navigation replay preserves both the correction and the separate composer draft, with no send before resolution.

These inspected screenshots contain synthetic fixtures only. Proof uses Chromium and the existing mocked Gateway; it does not represent a deployed-artifact update.

Before: navigation loses the correction and submits the original text

After: navigation preserves the correction and separate draft

@steipete steipete changed the title fix(ui): protect queued edits during update reloads fix(ui): preserve queued corrections across navigation and updates Sep 15, 2026
@steipete

Copy link
Copy Markdown
Contributor Author

Cross-page recovery regression: after leaving Chat for Agents, Review edit previously opened the conversation in the currently active split instead of restoring the split holding the unsaved correction. The matched repaired flow restores the owning split, its correction and separate draft, while preserving the other split.

The synthetic Chromium proof uses the existing mocked Gateway and source-mode update-recovery fixture; the reconnect banner is part of that fixture. It verifies recovery navigation and correction custody, not deployment of a new UI artifact. Both images were inspected and attached in the originating QA conversation.

Before: Review edit opens the wrong split

After: Review edit restores the correction in its owning split

@steipete
steipete force-pushed the codex/qa-queued-edit-reload branch from b188c86 to 13c9fc8 Compare September 15, 2026 20:45
@clawsweeper clawsweeper Bot added 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. and removed 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. labels Sep 15, 2026
@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation app: web-ui App: web-ui size: L maintainer Maintainer-authored PR labels Sep 15, 2026
@steipete
steipete merged commit 16f5ecd into main Sep 16, 2026
139 checks passed
@steipete
steipete deleted the codex/qa-queued-edit-reload branch September 16, 2026 03:36
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 16, 2026
…penclaw#149366)

* fix(ui): protect queued edits during update reloads

* refactor(ui): keep queued edit navigation with retained panes

* fix(ui): retain queued corrections through chat navigation

* fix(ui): recover queued edits across page navigation

* fix(test): unblock managed update fixture lint

(cherry picked from commit a494b6e)

* test(ui): wait for completed CLI discovery in refresh proof

* test(pr): share installed dependencies with alias fixtures

* test(pr): align alias setup with canonical checkout order

* test(pr): match landed alias fixture setup order
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 maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: L 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