Skip to content

fix: resume Settings autosave after Reload Config - #147136

Merged
steipete merged 2 commits into
mainfrom
codex/fix-settings-reload-autosave
Sep 13, 2026
Merged

steipete merged 2 commits into
mainfrom
codex/fix-settings-reload-autosave

Conversation

@steipete

@steipete steipete commented Sep 13, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes form edits remaining unsaved after reconnecting and choosing Reload Config in Settings.

User Impact

A successful reload discards the old draft and restores autosave for subsequent edits. Reloading while offline still preserves pending edits, including when the connection drops while an earlier save is settling.

Why This Change Was Made

Page reloads drained pending writes and replaced the draft without clearing the write coordinator's reconnect latch. All five callers now use that coordinator's existing discard operation. Its reload-only option preserves the pages' offline behavior; the footer's local discard behavior and background refreshes remain intact. The competing discard entry point, unused load-options export, and synchronous reset operation whose UI callers were removed in #107458 are retired. Production code decreases by 18 lines.

Evidence

The browser regression failed before the fix: after reconnecting, reloading, and selecting a new model, the UI returned to Autosave paused after reconnect and sent no config.set. After the fix, the same flow saved the fresh edit against the reloaded revision.

  • All four Agents browser cases passed against a freshly built production UI with a synthetic Gateway on the original fix, before the unused reset operation was removed.
  • All 293 remaining tests across 18 configuration-owner and caller suites passed again on the rebased head, including main's updated default-agent configuration case. Offline reloads, disconnects during write draining, late acknowledgements, conflicts, and publication recovery remain covered.
  • All required changed-file checks passed again on the rebased head, including core/UI typechecking, lint, i18n, and the dead-export scan. The original change and the reset retirement each passed independent P2 review without findings.
  • CI run 34770750927 passed the startup-size check at 354,553 bytes across seven JavaScript requests, also below the previous 355,719-byte limit. Main independently changed its budget and other UI code between runs; this PR changes no budget, and the size difference is not attributed solely to this cleanup.

That CI run failed only extension lint and the aggregate gate because main's Workboard test did not await its asynchronous harness cleanup. Main now includes that fix. This PR has been refreshed onto fc1975991f22403d4a8a723c2a27071bbc16d55f with the same patch; fresh CI for the rebased head is pending.

No operator Gateway or real provider/channel was used.

Before: the fresh edit remains unsaved with autosave paused

After: the fresh edit saves automatically after Reload Config

@clawsweeper

clawsweeper Bot commented Sep 13, 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 size: M maintainer Maintainer-authored PR labels Sep 13, 2026
@steipete
steipete marked this pull request as ready for review September 13, 2026 15:19
@clawsweeper clawsweeper Bot added 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. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 13, 2026
@clawsweeper

clawsweeper Bot commented Sep 13, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 13, 2026, 2:16 PM ET / 18:16 UTC (Revision 4).

ClawSweeper review

What this changes

Routes Settings reloads through the shared draft-discard operation so successful reloads restore autosave, preserves offline drafts, and removes unused reset paths.

Merge readiness

✅ Ready for maintainer review

This remains a useful fix: current main retains the faulty reload path, and the related merged work does not supersede it. No actionable introduced defect was found.

Priority: P2
Reviewed head: 6f933873ab1145b3bedb7cabf0d94676a5b78542

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused owner-level repair with meaningful browser evidence and regression coverage; no blocking defect found.
Proof confidence 🐚 platinum hermit (4/6) ✨ media proof bonus Sufficient (screenshot): The supplied production-browser run exercises Agents edits through the real UI coordinator against the approved synthetic Gateway boundary, reporting a fresh revision-checked save after reload; inspected before/after captures corroborate the visible recovery. It does not claim real-Gateway persistence coverage.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (screenshot): The supplied production-browser run exercises Agents edits through the real UI coordinator against the approved synthetic Gateway boundary, reporting a fresh revision-checked save after reload; inspected before/after captures corroborate the visible recovery. It does not claim real-Gateway persistence coverage.
Evidence reviewed 9 items Introduced change and complete caller cutover: The pinned merge-base delta routes all five page callers through discardDraft with reloadOnly, removes the competing refresh-discard entry point, and retires the unused synchronous reset. A reference search found no remaining calls to the retired configuration operations.
Success and failure behavior: Discard drains pending writes, reloads through the existing guarded config reader, and clears the reconnect latch only after a successful read. reloadOnly returns without a local reset when disconnected; publication-recovery checks remain in the reader.
Still necessary on current main: The fetched main's Agents Reload Config action still calls refresh with discardPendingChanges; that capability drains writes and loads the snapshot without clearing the coordinator's reconnect latch.
Findings None None.
Security None None.

How this fits together

The Control UI keeps a local settings draft and sends revision-checked writes to the Gateway. Its write coordinator manages autosave, reconnect pauses, and explicit discard or reload actions.

flowchart TD
  A[Settings edits] --> B[Local configuration draft]
  B --> C[Write coordinator]
  D[Reload Config] --> C
  C --> E{Fresh read succeeds?}
  E -->|Yes| F[Replace draft and resume autosave]
  E -->|Offline or failed| G[Keep pending draft]
  F --> C
  C --> H[Gateway configuration writes]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source -18, Tests +99, Docs +5. Total +86 across 18 files.

View PR surface stats
Area Files Added Removed Net
Source 8 13 31 -18
Tests 9 165 66 +99
Docs 1 5 0 +5
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 18 183 97 +86

Review metrics

None.

Technical review

Best possible solution:

Keep reload and discard lifecycle decisions in the existing write coordinator, preserving offline drafts and resuming autosave only after a successful reload.

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

Yes: retain an interrupted form edit across reconnect, choose Reload Config, then make a fresh edit. Current-main source leaves the reconnect latch set; the supplied browser regression reports that exact failure before the fix.

Is this the best way to solve the issue?

Yes: reusing the existing discard owner fixes the missed lifecycle transition without adding another reset mechanism, and reloadOnly preserves the pages' offline behavior.

AGENTS.md: found and applied where relevant.

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

Labels

Label justifications:

  • P2: Repairs a bounded Settings autosave failure after reconnect and explicit reload.
  • 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. Sufficient (screenshot): The supplied production-browser run exercises Agents edits through the real UI coordinator against the approved synthetic Gateway boundary, reporting a fresh revision-checked save after reload; inspected before/after captures corroborate the visible recovery. It does not claim real-Gateway persistence coverage.
  • proof: sufficient: Contributor real behavior proof is sufficient. The supplied production-browser run exercises Agents edits through the real UI coordinator against the approved synthetic Gateway boundary, reporting a fresh revision-checked save after reload; inspected before/after captures corroborate the visible recovery. It does not claim real-Gateway persistence coverage.
  • proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence. The supplied production-browser run exercises Agents edits through the real UI coordinator against the approved synthetic Gateway boundary, reporting a fresh revision-checked save after reload; inspected before/after captures corroborate the visible recovery. It does not claim real-Gateway persistence coverage.

Evidence

What I checked:

  • Introduced change and complete caller cutover: The pinned merge-base delta routes all five page callers through discardDraft with reloadOnly, removes the competing refresh-discard entry point, and retires the unused synchronous reset. A reference search found no remaining calls to the retired configuration operations. (ui/src/lib/config/runtime-config-capability.ts:40, 6f933873ab11)
  • Success and failure behavior: Discard drains pending writes, reloads through the existing guarded config reader, and clears the reconnect latch only after a successful read. reloadOnly returns without a local reset when disconnected; publication-recovery checks remain in the reader. (ui/src/lib/config/config-write-coordinator.ts:541, 6f933873ab11)
  • Still necessary on current main: The fetched main's Agents Reload Config action still calls refresh with discardPendingChanges; that capability drains writes and loads the snapshot without clearing the coordinator's reconnect latch. (ui/src/pages/agents/agents-page.ts:927, 83b9a532ef4c)
  • Latest release check: The v2026.9.4 source also retains the old refresh-discard implementation. The REST source read succeeded after the local release blob could not be retrieved. (ui/src/lib/config/runtime-config-capability.ts:234, 3a9d69db306c)
  • Browser evidence and regression boundary: Inspected both downloaded PR screenshots: before shows the reconnect pause and unsaved warning; after shows the selected fresh model without those warnings and with Save disabled. The captured PR body reports the production-browser regression failing before and passing afterward against a synthetic Gateway. The corresponding E2E checks the fresh config.set bytes, reloaded base hash, single submission, and Saved status. This is browser boundary proof, not real-Gateway persistence proof. (ui/src/e2e/agent-config-save.e2e.test.ts:111, 6f933873ab11)
  • Offline and late-acknowledgement coverage: The parameterized coordinator regression checks both local discard and reload-only behavior when connection loss interrupts draining, then verifies that a late acknowledgement cannot replace either result. Remaining draft-revision tests cover external changes and the retained discard operation. (ui/src/lib/config/config-write-coordinator.test.ts:985, 6f933873ab11)

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • obviyus: 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 (3 earlier review cycles)
  • reviewed 2026-09-13T15:26:37.008Z sha 90dfba0 :: needs maintainer review before merge. :: none
  • reviewed 2026-09-13T17:16:52.825Z sha 55bf0c5 :: needs maintainer review before merge. :: none
  • reviewed 2026-09-13T17:57:54.920Z sha 55bf0c5 :: needs maintainer review before merge. :: none

@steipete
steipete force-pushed the codex/fix-settings-reload-autosave branch from 90dfba0 to 55bf0c5 Compare September 13, 2026 17:09
Route page reloads through the config write coordinator so a successful
reload retires the reconnect latch. Preserve offline drafts with the
existing discard operation's reload-only mode and remove the parallel
discard entry point.

The real Agents browser regression failed before the fix and passes
afterward. All four browser cases, 294 owner/caller tests, changed-file
checks, and independent P2 review passed.
The UI moved to discardDraft in #107458. Remove the leftover capability
and coordinator method, retire its duplicate test scenario, and use the
real discard action or write suspension in remaining tests.

All 293 owner/caller tests and independent P2 delta review passed.
The full changed gate and startup-size investigation remain in progress.
@clawsweeper clawsweeper Bot added the proof: sufficient ClawSweeper judged the real behavior proof convincing. label Sep 13, 2026
@steipete
steipete force-pushed the codex/fix-settings-reload-autosave branch from 55bf0c5 to 6f93387 Compare September 13, 2026 18:06
@steipete
steipete merged commit 6c75805 into main Sep 13, 2026
129 of 131 checks passed
@steipete
steipete deleted the codex/fix-settings-reload-autosave branch September 13, 2026 19:04
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

vincentkoc added a commit that referenced this pull request Sep 13, 2026
* commit 'cf45ff4d6a9c13164463db860285a02c1c4f2e8c':
  test(macos): observe readiness cancellation and deadline ownership (#145056)
  fix(ci): route QA Profile Evidence to its run-status owner test (#147293)
  fix(install): preserve runtime links when Node validation fails (#147221)
  test(auto-reply): reuse memory session fixtures (#147262)
  fix: hide subagent sessions from Activity (#147253)
  ci: record resources for slow runtime test commands (#147254)
  fix(update): recognize FreeBSD boot identities in triage leases (#147243)
  refactor(active-memory): share closing tag line scan (#147031)
  fix: resume Settings autosave after Reload Config (#147136)
  fix(cli): keep conversation context after cancellation (#147139)
  fix(channels): make system-agent approval cards actionable (#147152)
  refactor: retain shared database handles until their last worker closes (#147246)
  refactor(slack): share workspace-qualified target resolution (#147024)
  refactor(msteams): remove duplicate quoted-table test (#147270)
vincentkoc added a commit that referenced this pull request Sep 13, 2026
* commit 'ac59d5e09eb468dc23cf95e447608b57e71b52af': (176 commits)
  improve(gateway): avoid redundant startup preflight work (#147285)
  test(macos): observe readiness cancellation and deadline ownership (#145056)
  fix(ci): route QA Profile Evidence to its run-status owner test (#147293)
  fix(install): preserve runtime links when Node validation fails (#147221)
  test(auto-reply): reuse memory session fixtures (#147262)
  fix: hide subagent sessions from Activity (#147253)
  ci: record resources for slow runtime test commands (#147254)
  fix(update): recognize FreeBSD boot identities in triage leases (#147243)
  refactor(active-memory): share closing tag line scan (#147031)
  fix: resume Settings autosave after Reload Config (#147136)
  fix(cli): keep conversation context after cancellation (#147139)
  fix(channels): make system-agent approval cards actionable (#147152)
  refactor: retain shared database handles until their last worker closes (#147246)
  refactor(slack): share workspace-qualified target resolution (#147024)
  refactor(msteams): remove duplicate quoted-table test (#147270)
  fix(qa): bind coverage IDs to producer assertions (#144000)
  fix(linux): explain FreeBSD desktop setup prerequisites (#147211)
  fix(memory): split embedding batches rejected for an input array item cap (#139541)
  test: isolate timing metadata persistence from inherited settings (#147112)
  refactor(status): retire test-only helper publication (#147071)
  ...
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 14, 2026
* fix: resume Settings autosave after reloading config

Route page reloads through the config write coordinator so a successful
reload retires the reconnect latch. Preserve offline drafts with the
existing discard operation's reload-only mode and remove the parallel
discard entry point.

The real Agents browser regression failed before the fix and passes
afterward. All four browser cases, 294 owner/caller tests, changed-file
checks, and independent P2 review passed.

* refactor: retire the unused Settings reset operation

The UI moved to discardDraft in openclaw#107458. Remove the leftover capability
and coordinator method, retire its duplicate test scenario, and use the
real discard action or write suspension in remaining tests.

All 293 owner/caller tests and independent P2 delta review passed.
The full changed gate and startup-size investigation remain in progress.
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: M 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