Skip to content

fix(ui): invisible autosave reconnect latch silently drops every Settings edit after gateway replacement - #123663

Merged
steipete merged 1 commit into
mainfrom
codex/autoqa-autosave-paused
Aug 14, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/autoqa-autosave-paused

Conversation

@steipete

Copy link
Copy Markdown
Contributor

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 ConfigAutoSaveStatus value, "paused": armed exactly where autoSaveRequiresExplicitSubmit is set (conflict outranks it — that snapshot is stale regardless), cleared exactly where the latch clears (explicit Save/Apply binding, discard), and deliberately excluded from resetStaleAutoSaveStatus so local edits cannot wipe it (mirroring "saving"/"conflict" persistence). The indicator renders "Autosave paused after reconnect" with a Save button wired to the existing onRetry → 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

  • Extended regression "keeps a stranded dirty draft unsaved until an explicit save after replacement" (runtime-config-capability.test.ts) now pins: paused becomes visible on replacement, survives further edits (which still don't autosave), and clears after explicit save. Fails pre-fix (expected 'idle' to be 'paused').
  • Existing conflict-persistence test proves conflict still outranks the latch; full ui/src/lib/config suites + settings-save-indicator suite green; pnpm tsgo:ui clean; oxfmt/oxlint clean.
  • Autoreview (Codex, gpt-5.6-sol high): clean, 0.99 correctness.
  • Production LOC: +36/−7 (new visible state is new surface by design — the alternative of auto-resuming autosave on the new connection would silently submit bytes the operator composed against a different gateway, the exact hazard the latch exists to prevent).

AI-assisted: yes (autonomous QA campaign; autoreview workflow).

…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.
@clawsweeper

clawsweeper Bot commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@steipete
steipete marked this pull request as ready for review August 14, 2026 13:07
@openclaw-barnacle openclaw-barnacle Bot added app: web-ui App: web-ui size: S maintainer Maintainer-authored PR labels Aug 14, 2026
@clawsweeper clawsweeper Bot added P1 High-priority user-facing bug, regression, or broken workflow. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Aug 14, 2026
@clawsweeper

clawsweeper Bot commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 14, 2026, 9:12 AM ET / 13:12 UTC.

ClawSweeper review

What this changes

The PR exposes a paused Settings autosave state after Gateway replacement and lets the operator explicitly save the retained draft.

Regression provenance

Possible regression — suspected (reviewed change). No predecessor PR is attributed.

Merge readiness

⚠️ Ready for maintainer review - 3 items remain

Keep 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
Reviewed head: 3d7bc2ddb5a39c66439e317cc9dda303d16e4884

Review scores

Measure Result What it means
Overall readiness 🦞 diamond lobster (5/6) PR readiness rating was derived from proof quality, review findings, security review, and reviewer confidence.
Proof confidence 🌊 off-meta tidepool Not applicable: Real behavior proof is not required for maintainer- or bot-authored pull requests.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: Real behavior proof is not required for maintainer- or bot-authored pull requests.
Evidence reviewed 5 items Current-main silent latch: Current main arms the explicit-submit latch for a retained form draft after a connection change, while its autosave status type has no paused value to expose that condition.
Existing lifecycle coverage: The current capability test proves that a dirty draft remains unsaved after replacement, but it does not provide an operator-visible state; the PR extends that same lifecycle assertion.
Owner-boundary fix: The branch sets paused at the same reconnect latch that blocks autosave, preserves it across local edits, clears it through existing explicit-save/discard transitions, and reuses the existing save callback in the sidebar.
Findings None None.
Security None None.

How this fits together

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

Before merge

  • Resolve merge risk (P1) - The PR has no after-fix rendered Settings proof; the capability test proves state transitions but not the visible paused row and Save action required by the UI policy.
  • Resolve merge risk (P1) - Production changes are +36/-6 (net +30); the added explicit state is justified because reusing error or conflict would misrepresent the latch, but this should remain limited to the existing coordinator-to-indicator path.
  • Complete next step (P2) - Attach the required rendered UI proof and let exact-head CI complete; no mechanical repair is needed from the review.
Agent review details

Security

None.

PR surface

Source +30, Tests +11. Total +41 across 6 files.

View PR surface stats
Area Files Added Removed Net
Source 5 36 6 +30
Tests 1 12 1 +11
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 6 48 7 +41

Review metrics

Metric Value Why it matters
Production versus test LOC production +36/-6, tests +12/-1 The visible latch requires a status union, coordinator transitions, indicator rendering, and localized copy; the changed test exercises the reconnect lifecycle.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    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.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

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

Labels

Label changes:

  • add P1: A Gateway reconnect can otherwise leave a dirty Settings form unable to autosave with no operator-visible explanation.
  • add rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🌊 off-meta tidepool and patch quality is 🦞 diamond lobster.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: Real behavior proof is not required for maintainer- or bot-authored pull requests.

Label justifications:

  • P1: A Gateway reconnect can otherwise leave a dirty Settings form unable to autosave with no operator-visible explanation.
  • rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🌊 off-meta tidepool and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: Real behavior proof is not required for maintainer- or bot-authored pull requests.

Evidence

What I checked:

  • Current-main silent latch: Current main arms the explicit-submit latch for a retained form draft after a connection change, while its autosave status type has no paused value to expose that condition. (ui/src/lib/config/config-write-coordinator.ts:396, 641821f25e3e)
  • Existing lifecycle coverage: The current capability test proves that a dirty draft remains unsaved after replacement, but it does not provide an operator-visible state; the PR extends that same lifecycle assertion. (ui/src/lib/config/runtime-config-capability.test.ts:302, 641821f25e3e)
  • Owner-boundary fix: The branch sets paused at the same reconnect latch that blocks autosave, preserves it across local edits, clears it through existing explicit-save/discard transitions, and reuses the existing save callback in the sidebar. (ui/src/lib/config/config-write-coordinator.ts:402, 3d7bc2ddb5a3)
  • History and likely ownership: The reconnect latch, status model, reset logic, and initial indicator branches trace to the current-main commit that introduced this configuration surface. (ui/src/lib/config/config-write-coordinator.ts:400, c0930de5dea1)
  • Missing rendered proof: The PR body reports capability tests and static checks, but supplies no screenshot, recording, terminal output, or linked artifact showing the new Settings row after reconnect.

Likely related people:

  • steipete: Current-main blame ties the reconnect latch, status model, reset behavior, and sidebar indicator to Peter Steinberger's commit; the PR metadata identifies the same contributor as steipete. (role: introduced related configuration lifecycle and recent area contributor; confidence: high; commits: c0930de5dea1, 5c81ed5883ce, d885f9175db0; files: ui/src/lib/config/config-write-coordinator.ts, ui/src/lib/config/config-state-model.ts, ui/src/lib/config/config-draft-model.ts)

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.

@steipete
steipete merged commit 5523f8a into main Aug 14, 2026
315 of 321 checks passed
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

@steipete
steipete deleted the codex/autoqa-autosave-paused branch August 14, 2026 13:36
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 15, 2026
…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.
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 P1 High-priority user-facing bug, regression, or broken workflow. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. size: S 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