Repository navigation
fix(ui): invisible autosave reconnect latch silently drops every Settings edit after gateway replacement - #123663
Conversation
…er saving When a gateway connection is replaced while a config form draft is dirty, autosave intentionally latches off (autoSaveRequiresExplicitSubmit) until an explicit Save — but the latch was invisible: the indicator rendered nothing on idle, form mode has no Save button, and every subsequent edit (plus the dispose-time teardown flush) silently never saved. A recorded fact existed in the coordinator with no read where the operator needed it. The latch now projects a visible "paused" autosave status owned by the same arm/clear transitions (conflict outranks it; local edits cannot clear it), and the save indicator renders "Autosave paused after reconnect" with a Save action reusing the existing retry plumbing.
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 14, 2026, 9:12 AM ET / 13:12 UTC. ClawSweeper reviewWhat this changesThe PR exposes a paused Settings autosave state after Gateway replacement and lets the operator explicitly save the retained draft. Regression provenancePossible regression — suspected (reviewed change). No predecessor PR is attributed. Merge readinessKeep open: this is a focused repair for a current-main silent default-path failure, and the proposed owner-boundary projection is correct. It remains a maintainer-handled PR with required UI proof and exact-head CI pending. Priority: P1 Review scores
Verification
How this fits togetherThe Control UI holds a local Settings draft and the configuration write coordinator decides whether it may autosave to the active Gateway connection. The Settings sidebar renders that state and routes an explicit save through the existing runtime configuration capability. flowchart LR
A[Settings form edit] --> B[Configuration write coordinator]
C[Gateway replacement] --> B
B --> D[Paused draft state]
D --> E[Settings sidebar indicator]
E --> F[Explicit Save]
F --> G[Gateway config write]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +30, Tests +11. Total +41 across 6 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Retain the distinct coordinator-owned paused state, reuse the existing explicit-save path, and attach sanitized browser proof that reconnect displays the row and saves the retained draft. Do we have a high-confidence way to reproduce the issue? Yes. Current main latches a dirty form draft after a connection change and prevents autosave; the existing capability test reproduces that sequence, and the branch asserts the missing paused state. Is this the best way to solve the issue? Yes. The latch owner publishes the status at its own arm/clear transitions, while the indicator reuses the existing Save callback; overloading error or conflict would give the operator false information. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 641821f25e3e. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Merged via squash.
|
…er saving (openclaw#123663) When a gateway connection is replaced while a config form draft is dirty, autosave intentionally latches off (autoSaveRequiresExplicitSubmit) until an explicit Save — but the latch was invisible: the indicator rendered nothing on idle, form mode has no Save button, and every subsequent edit (plus the dispose-time teardown flush) silently never saved. A recorded fact existed in the coordinator with no read where the operator needed it. The latch now projects a visible "paused" autosave status owned by the same arm/clear transitions (conflict outranks it; local edits cannot clear it), and the save indicator renders "Autosave paused after reconnect" with a Save action reusing the existing retry plumbing.
What Problem This Solves
When the gateway connection is replaced while a Settings form draft is dirty (gateway restart, event-gap reconnect after sleep), autosave intentionally latches off (
autoSaveRequiresExplicitSubmit) until an explicit Save — the retained bytes belong to the old connection. But the latch was completely invisible: the save indicator renders nothing on "idle", form mode has no Save button, and the status was reset to idle on disconnect. The operator sees a perfectly normal-looking form where every subsequent edit silently never saves, and the dispose-time teardown flush is blocked by the same guard, so closing the tab drops everything. A recorded fact existed in the coordinator with no read where the user needed it — the worst bug class (silent failure) on a default path.Why This Change Was Made
The latch's own arm/clear transitions are the correct owner for the visible state, so the fix projects a fifth
ConfigAutoSaveStatusvalue,"paused": armed exactly whereautoSaveRequiresExplicitSubmitis set (conflict outranks it — that snapshot is stale regardless), cleared exactly where the latch clears (explicit Save/Apply binding, discard), and deliberately excluded fromresetStaleAutoSaveStatusso local edits cannot wipe it (mirroring "saving"/"conflict" persistence). The indicator renders "Autosave paused after reconnect" with a Save button wired to the existingonRetry → runtimeConfig.save()plumbing — no new component, no new callback surface.User Impact
After a gateway restart with unsaved Settings edits, the form now shows a persistent "Autosave paused after reconnect — Save" row instead of silently discarding all further work.
Evidence
expected 'idle' to be 'paused').pnpm tsgo:uiclean; oxfmt/oxlint clean.AI-assisted: yes (autonomous QA campaign; autoreview workflow).