Skip to content

fix(ui): settings reload can overflow the browser stack - #147970

Merged
steipete merged 6 commits into
mainfrom
codex/qa-runtime-config-reentry
Sep 14, 2026
Merged

steipete merged 6 commits into
mainfrom
codex/qa-runtime-config-reentry

Conversation

@steipete

@steipete steipete commented Sep 14, 2026 •

Copy link
Copy Markdown
Contributor

The shared mainline fixture-assertion blocker is resolved upstream in #148129. This branch is rebased onto main containing that fix; the reviewed 18-file settings and timing patch is unchanged. Exact-head CI now passes on the refreshed head after one diagnosed, bounded failed-job rerun.

What Problem This Solves

Reloading Control UI settings could overflow the browser stack. A settings subscriber requested missing configuration during a synchronous notification before the loader had registered its pending request.

User Impact

Settings loads, refreshes, reconnects, and discards now share the existing request owner. Preferences persist and repeated reloads complete without browser exceptions. Explicit retries and pending-write coordination are preserved.

Why This Change Was Made

Register each load before publishing and remove it by identity after final notification. Remove the separate tracking adapter so every refresh path follows the same lifecycle. Pending-write draining owns the scheduled draft flush.

The CI repair gives wall-clock Markdown tests one serial execution owner across package, root, selected-target, and hosted compact runners. Their existing assertions and time budgets are retained. Main now supplies the startup catalog, resize setup, and transcript test-size repairs from #147973 and #148010; this PR uses those upstream fixes and contains no competing versions or budget-policy changes.

Evidence

The refreshed-head CI hit one unchanged backend timeout in server.config-patch.test.ts: its first owner-reload case exceeded a 20-second config.patch request deadline on a two-CPU runner. The full original-order file passes locally on matching Node 24.19.0 (79/79 tests; first case 16.758 seconds total), with every assertion and timeout unchanged. The Gateway production and test files are identical to the trusted main base. A fresh-cache two-CPU phase probe also passed with the original deadlines: seed and cold-reference writes took 523 ms and 312 ms; secret preparation and model refresh each took under 25 ms. Independent source review found no concrete race or justified code repair. The original failure and replay logs are retained. One bounded failed-job rerun passed, and exact-head CI attempt 2 is green on a25a14e9b77722ad9ebff51c8db3c246887ecfb7. No source, assertions, or time limits were changed.

Fresh whole-diff independent P2 review is clean across three passes.

The original configuration code failed meaningful reentrant-load regressions. The consolidated candidate passes 308 settings tests, 958 routing/planner tests, and all 40 upstream controller/message-reveal cases. Focused lint, including the original transcript size check, passes. Both upstream resize E2E cases pass with zero anchor drift at 1000, 820, and 1280 px. Canonical startup is 357,427 B across seven requests, within the repository budget.

The previous reviewed head passed hosted CI after one bounded retry of an unchanged CLI process test. Its original timeout did not reproduce in the full 18-case file on matching Node 24.19.0; no source, assertions, or time limits were changed for the retry. A subsequent real conflict with newly merged mainline fixes required the consolidation described above. Final-head hosted CI remains a landing gate.

Live isolated Chromium proof uses synthetic data and a real Gateway. The served JavaScript is byte-matched to the candidate build. Dark mode, 110% text size, and Tide preferences persist across reload; System/100%/Claw are restored afterward, and three rapid reloads produce zero browser page exceptions. Inspected before/after captures are visibly attached in the originating chat and embedded below.

Before

Settings before the load-owner repair

After

Settings after the load-owner repair

@clawsweeper

clawsweeper Bot commented Sep 14, 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 14, 2026 05:51
@openclaw-barnacle openclaw-barnacle Bot added app: web-ui App: web-ui size: S maintainer Maintainer-authored PR labels Sep 14, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. 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 14, 2026
@clawsweeper

clawsweeper Bot commented Sep 14, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 14, 2026, 7:51 AM ET / 11:51 UTC (Revision 11).

ClawSweeper review

What this changes

The PR prevents recursive settings loads by registering pending requests before notifying subscribers and gives Markdown timing tests separate scheduling across test runners.

Merge readiness

✅ Ready for maintainer review

The fix remains necessary: fetched main and the latest release retain the recursive-load mechanism. The reviewed patch has no actionable correctness findings, and the related merged repairs do not supersede it.

Priority: P2
Reviewed head: a25a14e9b77722ad9ebff51c8db3c246887ecfb7

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused runtime simplification with meaningful regression coverage and consistent test routing; no blocking patch defects were found.
Proof confidence 🌊 off-meta tidepool Not applicable: The ordinary contributor-proof gate is exempt for this maintainer-authored PR, and no material authority change triggers an exception. Inspected settings captures supplement the reported real-Gateway Chromium reload replay; they do not independently prove the absence of browser exceptions.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The ordinary contributor-proof gate is exempt for this maintainer-authored PR, and no material authority change triggers an exception. Inspected settings captures supplement the reported real-Gateway Chromium reload replay; they do not independently prove the absence of browser exceptions.
Evidence reviewed 8 items Introduced load lifecycle repair: The complete local introduced diff registers the task promise before publishing and deletes it by identity after final notification. Refresh, reconnect, discard, and external-mutation refresh use this owner; the separate tracking adapter is removed.
Current-main necessity: Fetched main still calls run(task), which synchronously publishes, before trackLoad registers the request. The settings page requests missing configuration during synchronization, providing the reentrant caller. Main has no changes from the pinned base in either modified runtime owner.
Latest release retains the old ordering: The runtime configuration source at the supplied v2026.9.4 release commit also publishes before registering the pending load; this repair is not present there.
Findings None None.
Security None None.

How this fits together

The Control UI configuration owner loads Gateway settings and notifies settings editors when their state changes. It also coordinates refreshes with pending writes so editors receive current configuration without losing draft intent.

flowchart TD
  A[Settings editor or reconnect] --> B[Configuration load owner]
  B --> C{Request already pending?}
  C -->|Yes| D[Share pending result]
  C -->|No| E[Register Gateway request]
  E --> F[Notify settings subscribers]
  F --> B
  E --> G[Apply current result and retire request]
  D --> G
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source -5, Tests +306, Other +10. Total +311 across 18 files.

View PR surface stats
Area Files Added Removed Net
Source 3 58 63 -5
Tests 13 311 5 +306
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 2 13 3 +10
Total 18 382 71 +311

Review metrics

Metric Value Why it matters
Runtime versus validation growth Runtime −26 lines; tests +244; test tooling +93 Runtime ownership becomes smaller; added validation protects reentry and preserves timing-suite selection across runners.

Technical review

Best possible solution:

Keep pending-load registration and notification cleanup in the existing operation owner while preserving connection guards, explicit retries, draft draining, and unchanged timing budgets.

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

Yes, from source: an offline or background load publishes before registration, allowing a settings subscriber to recursively request the still-missing snapshot. This review did not execute the application.

Is this the best way to solve the issue?

Yes. Consolidating registration into the existing operation owner repairs the ordering invariant across callers without adding another guard or competing tracker.

AGENTS.md: found and applied where relevant.

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

Labels

Label justifications:

  • P2: This repairs a bounded settings-reload failure without evidence of a broader runtime outage.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The ordinary contributor-proof gate is exempt for this maintainer-authored PR, and no material authority change triggers an exception. Inspected settings captures supplement the reported real-Gateway Chromium reload replay; they do not independently prove the absence of browser exceptions.
  • proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence. The ordinary contributor-proof gate is exempt for this maintainer-authored PR, and no material authority change triggers an exception. Inspected settings captures supplement the reported real-Gateway Chromium reload replay; they do not independently prove the absence of browser exceptions.

Evidence

What I checked:

  • Introduced load lifecycle repair: The complete local introduced diff registers the task promise before publishing and deletes it by identity after final notification. Refresh, reconnect, discard, and external-mutation refresh use this owner; the separate tracking adapter is removed. (ui/src/lib/config/runtime-config-capability.ts:109, a25a14e9b777)
  • Current-main necessity: Fetched main still calls run(task), which synchronously publishes, before trackLoad registers the request. The settings page requests missing configuration during synchronization, providing the reentrant caller. Main has no changes from the pinned base in either modified runtime owner. (ui/src/lib/config/runtime-config-capability.ts:110, 9a5af1b95370)
  • Latest release retains the old ordering: The runtime configuration source at the supplied v2026.9.4 release commit also publishes before registering the pending load; this repair is not present there. (ui/src/lib/config/runtime-config-capability.ts:112, 3a9d69db306c)
  • Meaningful regression coverage: Six added cases cover offline reentry, background-load sharing, immediate loading notifications, explicit retries, and cleanup after a throwing observer. They exercise the configuration capability boundary. Tests were inspected, not executed during this read-only review. (ui/src/lib/config/runtime-config-capability.loading.test.ts:8, a25a14e9b777)
  • Timing test ownership: Package, root, selected-target, and hosted compact routes select the timing suite through its dedicated owner. Hosted stripes exclude it while the support group includes its configuration. The underlying Markdown assertions and 100 ms limits are unchanged. (scripts/lib/ci-node-test-plan.mts:1802, a25a14e9b777)
  • Saved visual evidence and reported live replay: Inspected prepared images 1, 2, and 3 from the media manifest. They show the Appearance settings page, without runtime diagnostics. The captured body and fix(ui): settings reload can overflow the browser stack #147970 (comment) separately report an isolated real-Gateway Chromium replay, bundle identity verification, preference persistence, and three rapid reloads with zero page exceptions. Screenshots alone do not establish those runtime claims.

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 (10 earlier review cycles; latest 8 shown)
  • reviewed 2026-09-14T06:47:20.136Z sha a6e6a48 :: blocked before merge. :: none
  • reviewed 2026-09-14T07:01:13.904Z sha bdf7290 :: blocked before merge. :: none
  • reviewed 2026-09-14T07:09:05.463Z sha bdf7290 :: blocked before merge. :: none
  • reviewed 2026-09-14T07:27:07.982Z sha 7cbba90 :: needs maintainer review before merge. :: none
  • reviewed 2026-09-14T08:03:32.260Z sha be9b713 :: needs maintainer review before merge. :: none
  • reviewed 2026-09-14T09:14:57.439Z sha 075f2b3 :: needs maintainer review before merge. :: none
  • reviewed 2026-09-14T09:50:09.660Z sha 075f2b3 :: needs maintainer review before merge. :: none
  • reviewed 2026-09-14T11:23:47.854Z sha a25a14e :: needs maintainer review before merge. :: none

@steipete
steipete force-pushed the codex/qa-runtime-config-reentry branch from 1b89b5f to a6e6a48 Compare September 14, 2026 06:19
@steipete

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

The final revision consolidates request tracking into the existing operation owner and removes the superseded tracking adapter. All 308 related tests pass, and the final served bundle passes the live settings reload replay with zero browser exceptions. The body contains the refreshed inspected screenshots and explicitly retains the outstanding performance-gate failure.

@clawsweeper

clawsweeper Bot commented Sep 14, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@steipete

Copy link
Copy Markdown
Contributor Author

Exact-head CI for a6e6a48 is blocked: run 34812945772.

The startup-performance job measured 362,121 B against the 361,938 B hard limit on the CI merge tree. The local fixed-identity candidate measured 361,955 B. No baseline or limit was changed. Related startup work remains in #147954, which has an assigned maintainer and an unresolved immediate-loading-frame review finding.

UI shard 2 passed 6,922 tests and failed the same two unchanged-main markdown timing cases seen on the previous head (136.67 ms and 124.81 ms against 100 ms). The settings-specific 308-test batch and final live browser replay remain green. The separate oversized sidebar-helper failure is also being repaired independently.

@steipete
steipete force-pushed the codex/qa-runtime-config-reentry branch from a6e6a48 to bdf7290 Compare September 14, 2026 06:52
@openclaw-barnacle openclaw-barnacle Bot added the scripts Repository scripts label Sep 14, 2026
@steipete

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

CI repairs are pushed at bdf7290. The hosted startup-performance gate now passes. The existing lazy-catalog/sidebar prerequisite comes from #147973; unchanged markdown timing assertions now run after other UI work in every runner route, with observed three-worker package and root ordering proof. Fresh independent whole-PR review found no actionable issues. Settings308 and project/sidebar444 tests pass, and the served combined UI passes preference persistence and repeated reloads without browser exceptions. Inspected screenshots render in the body. Remaining hosted CI is running.

@clawsweeper

clawsweeper Bot commented Sep 14, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@steipete

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Final CI follow-up is 7cbba90. Startup performance and UI2/3 passed on the previous run. The hosted compact planner now actually assigns the timing suite once through its existing serial support owner; its new regression fails on all three backend plans before repair. The main-branch transcript test-size failure is fixed by extracting four unchanged MCP lifecycle cases with their original isolated runner. Final proof: 76 planner tests, 40 transcript tests, 20 package-runner tests, affected type graphs, focused lint, and fresh independent whole-PR review all pass. Full earlier core/UI/scripts/root type checks, i18n, and dead-export scans pass. UI production code and inspected live screenshot evidence remain unchanged by this follow-up.

@clawsweeper

clawsweeper Bot commented Sep 14, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

@clawsweeper clawsweeper Bot added the proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. label Sep 14, 2026
@steipete
steipete force-pushed the codex/qa-runtime-config-reentry branch from 0f5a04f to be9b713 Compare September 14, 2026 07:47
@steipete

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Current head is be9b713, rebased onto 4ddb9ed after a real merge conflict. The conflict resolution retains the remaining lazy project labels alongside the three labels now on main, plus main's numbered transcript fixture helper alongside the already-reviewed lifecycle extraction. Runtime load fixes are patch-identical. Previous CI passed every job except one resize-anchor E2E case and the aggregate gate. The reviewed test-only follow-up selects an initial row starting inside the viewport; widths, exact-key visibility, and 120 px drift limit are unchanged. Both tests pass locally, and restoring the historical measurement reset fails with 217 px drift and missing anchors. Exact CI geometry was not reproduced locally. Fresh CI: https://github.com/openclaw/openclaw/actions/runs/34819489130. Conflict-focused proof and current bundle checks are running; required checks remain a landing gate.

@clawsweeper

clawsweeper Bot commented Sep 14, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@steipete

Copy link
Copy Markdown
Contributor Author

Rebased live proof on be9b713: served JavaScript matches the candidate SHA256; Dark mode,110% text size and Tide persist after reload. Restored System/100%/Claw and repeated three rapid reloads with zero browser page errors. This inspected, synthetic-only after capture is also visibly attached in the originating chat. The original before capture remains in the PR body.

isolated-1789372293255

@clawsweeper clawsweeper Bot removed the proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. label Sep 14, 2026
@steipete

steipete commented Sep 14, 2026 •

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Current head is 075f2b3 on main 43d413b. The exact earlier CI was green, but new mainline changes caused a real merge conflict before dispatch. The consolidated diff now contains only the runtime configuration owner and timing-runner ownership; main owns the catalog, native-wheel resize setup, and transcript test organization. No duplicate fixes or budget-policy changes remain.

Fresh whole-diff P2 review is clean across all three passes. Proof: 1,306 focused tests, both upstream resize E2E cases with zero drift at all three widths, focused lint, and startup at 357,427 B across seven requests pass. Live candidate SHA256 matches the served bundle; Dark/110% and Tide persist after reload, defaults are restored, and three rapid reloads produce zero page exceptions. New exact-head CI: https://github.com/openclaw/openclaw/actions/runs/34824943740. Required CI remains a landing gate.

The inspected synthetic-only current after capture is visibly attached in the originating chat. Original before capture stays in the PR body.

Settings after consolidated load-owner repair

@clawsweeper

clawsweeper Bot commented Sep 14, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper

clawsweeper Bot commented Sep 14, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

Reuse the existing lazy project catalog and sidebar fixture simplification from #147973. Preserve full-render timing limits while scheduling their owner after other UI projects across runner routes.
Preserve exact hosted test inventory and isolated MCP lifecycle coverage. Keep renderer timing assertions and lint limits unchanged.
@steipete
steipete force-pushed the codex/qa-runtime-config-reentry branch from 075f2b3 to a25a14e Compare September 14, 2026 11:07
@clawsweeper clawsweeper Bot added the proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. label Sep 14, 2026
@steipete
steipete merged commit ecf6da8 into main Sep 14, 2026
255 of 259 checks passed
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

@steipete
steipete deleted the codex/qa-runtime-config-reentry branch September 14, 2026 12:44
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 15, 2026
)

* fix(ui): settings reload can overflow the browser stack

* refactor(ui): unify pending configuration load tracking

* refactor(ui): track config loads in the operation owner

* refactor(ui): let config drain own pending draft flushing

* fix(ui): restore CI budgets and isolate render timing checks

Reuse the existing lazy project catalog and sidebar fixture simplification from openclaw#147973. Preserve full-render timing limits while scheduling their owner after other UI projects across runner routes.

* fix(ci): complete timing ownership and split transcript lifecycle tests

Preserve exact hosted test inventory and isolated MCP lifecycle coverage. Keep renderer timing assertions and lint limits unchanged.
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 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. scripts Repository scripts 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