Skip to content

fix: recover Cloud Workers profile saves after reconnect - #127150

Merged
steipete merged 1 commit into
mainfrom
codex/autoqa-cloud-workers-reconnect
Aug 21, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/autoqa-cloud-workers-reconnect

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes an issue where operators saving a Cloud Workers profile would remain permanently stuck on Saving… when the Gateway reconnected before config.patch settled. The same mounted editor retained its draft, but Profile ID, backend, Save, and Cancel all stayed disabled after the Gateway was connected again.

Why This Change Was Made

AI-assisted. Cloud Workers already uses the page Gateway lifecycle as the authority for retiring in-flight requests. Its invalidator reset catalog ownership but omitted busyProfileId, while the retired request's guarded finally correctly refused to mutate current state. The page's existing Gateway reset now releases busy ownership together with catalog request state, preserving the editor and draft and keeping retired completions silent.

The browser regression exercises the real same-client reconnect order: defer config.patch, reconnect, verify recovery and exact preserved draft, settle the retired request silently, then issue exactly one fresh retry and complete it.

Production LOC: +4/-3 (net +1). Tests: +108/-0. The one production line adds the missing lifecycle ownership transition; no request, config, permission, or persistence behavior changes.

Provenance: the Cloud Workers profile editor was introduced in #124864 (78beccf053974beb42d561471f35fe4954c52c61, 2026-08-17). Live searches for cloud workers reconnect saving, cloud workers stuck, and cloud-workers config.patch found no exact open issue or PR.

User Impact

After a transient Gateway reconnect, operators keep their in-progress Cloud Workers profile draft and can immediately retry or cancel instead of reloading the page and re-entering the profile.

Evidence

Authentic pre-fix source-Chromium regression:

FAIL releases a retired profile save after reconnect while preserving the draft
expected false to be true
ui/src/e2e/cloud-workers-settings.e2e.test.ts:325
profileId.isEnabled() remained false

Exact post-fix proof on the rebased head:

cloud-workers-settings.e2e.test.ts: 4/4 passed
cloud-worker-config.test.ts: 11/11 passed

The exact changed-file gate passed formatting, UI/core-test typechecks, i18n verification, lint, dead exports, and policy guards. The pre/post rebase patch IDs match (d421a539ec764cd0c3dfb7c3b96320c63f7f384d), and the focused browser and owner tests passed again after rebasing.

Fresh independent high-mode review found no P0-P3 issues and judged the Gateway invalidator the correct owner-boundary fix. The repository Codex autoreview helper's previously disclosed authentication failure prevented the lead from rerunning that helper; independent high-mode review is the substitute.

Before: draft preserved but permanently busy

Cloud Workers profile fields disabled on Saving after reconnect

After: same draft recovered with Save and Cancel enabled

Cloud Workers profile fields recovered after reconnect

@clawsweeper

clawsweeper Bot commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@openclaw-barnacle openclaw-barnacle Bot added app: web-ui App: web-ui size: S maintainer Maintainer-authored PR labels Aug 21, 2026
@steipete
steipete marked this pull request as ready for review August 21, 2026 10:33
@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 Aug 21, 2026
@clawsweeper

clawsweeper Bot commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 21, 2026, 6:40 AM ET / 10:40 UTC.

ClawSweeper review

What this changes

The PR clears the Cloud Workers profile editor’s busy-save state on Gateway reset and adds a browser regression test for reconnect during a deferred save.

Regression provenance

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

Merge readiness

⚠️ Ready for maintainer review - 2 items remain

Keep open: current main can leave a Cloud Workers profile editor permanently busy after a reconnect, and this PR places the release at the Gateway lifecycle owner. No blocking correctness or security issue was found; wait for exact-head CI before normal maintainer merge handling.

Priority: P2
Reviewed head: 0fcf0634559984d9d2302bf513f630f736bad8e0

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused owner-boundary repair with a strong browser regression sequence and visible before/after evidence.
Proof confidence 🌊 off-meta tidepool Not applicable: This is maintainer-authored; the external-contributor proof gate does not apply, and the supplied before/after screenshots visibly show the draft preserved with controls restored.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This is maintainer-authored; the external-contributor proof gate does not apply, and the supplied before/after screenshots visibly show the draft preserved with controls restored.
Evidence reviewed 7 items Current-main defect: Current main sets busyProfileId before config.patch but clears it only when the original Gateway scope remains current; the pre-PR reset handler does not release this state.
Owner-boundary repair: The PR resets busyProfileId together with catalog request state when the Gateway invalidates page work, so a retired save cannot strand the editor.
Lifecycle contract: GatewayPageController invokes the page invalidator after a lifecycle transition, making the page invalidator the canonical owner for retiring page-local request state.
Findings None None.
Security None None.

Live Verification

Command: node scripts/run-vitest.mjs run --config test/vitest/vitest.ui-e2e.config.ts --configLoader runner ui/src/e2e/cloud-workers-settings.e2e.test.ts

Result: FAIL (failed) — step 1 run node scripts/run-vitest.mjs run --config test/vitest/vitest.ui-e2e.config.ts --configLoader runner ui/src/e2e/cloud-workers-settings.e2e.test.ts: terminal command did not produce output within 20 seconds: "node scripts/run-vitest.mjs run --config test/vitest/vitest.ui-e2e.config.ts --configLoader runner ui/src/e2e/cloud-workers-settings.e2e.test.ts"

node scripts/run-vitest.mjs run --config test/vitest/vitest.ui-e2e.config.ts --configLoader runner ui/src/e2e/cloud-workers-settings.e2e.test.ts
runner@runnervm76f27:/tmp/clawsweeper-live-proof-127150-q9XvKr/target$ node scripts/run-vitest.mjs run --config test/vitest/vitest.ui-e2e.config.ts --configLoad
er runner ui/src/e2e/cloud-workers-settings.e2e.test.ts

 RUN  v4.1.10 /tmp/clawsweeper-live-proof-127150-q9XvKr/target

node scripts/run-vitest.mjs run --config test/vitest/vitest.ui-e2e.config.ts --configLoader runner ui/src/e2e/cloud-workers-settings.e2e.test.ts












































Assertions:

  • FAIL expect_output: releases a retired profile save after reconnect while preserving the draft
  • FAIL expect_output: passed

How this fits together

The Cloud Workers settings page saves profile configuration through the Gateway. When a reconnect retires an in-flight request, the page must release its UI save ownership without discarding the operator’s draft.

flowchart LR
A[Operator edits Cloud Workers profile] --> B[Settings page starts save]
B --> C[Gateway request in flight]
C --> D[Gateway reconnect resets page state]
D --> E[Release save ownership]
E --> F[Draft stays editable for retry or cancel]
Loading

Before merge

  • Resolve merge risk (P1) - Production code is net +1 line; the assignment is the direct page-owner transition required to release a retired save rather than a downstream workaround.
  • Complete next step (P2) - No repair-lane action is needed; keep this maintainer-owned PR open for exact-head CI and normal merge handling.
Agent review details

Security

None.

PR surface

Source +1, Tests +108. Total +109 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 1 4 3 +1
Tests 1 108 0 +108
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 112 3 +109

Review metrics

Metric Value Why it matters
Production vs test LOC production +1 net; browser regression +108 The sole production growth releases page-owned busy state on reset; the test covers reconnect ordering and retry.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Land the reset-level busy-state release once exact-head CI is green; no net-neutral refactor can absorb this distinct page-owned state transition.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best possible solution:

Land the reset-level busy-state release once exact-head CI is green; no net-neutral refactor can absorb this distinct page-owned state transition.

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

Yes. Current source proves the retired-scope cleanup skips busy-state release on reconnect, and the focused E2E deterministically exercises that deferred-save/reconnect order.

Is this the best way to solve the issue?

Yes. The Gateway invalidator owns retirement of page requests, and the change mirrors the existing Labs-page state-reset pattern rather than allowing stale completions to alter current state.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 9b37e538a8f9.

Labels

Label changes:

  • add P2: A transient reconnect can strand a Cloud Workers editor until reload, but the repair is localized and recoverable.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This is maintainer-authored; the external-contributor proof gate does not apply, and the supplied before/after screenshots visibly show the draft preserved with controls restored.

Label justifications:

  • P2: A transient reconnect can strand a Cloud Workers editor until reload, but the repair is localized and recoverable.
  • 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: This is maintainer-authored; the external-contributor proof gate does not apply, and the supplied before/after screenshots visibly show the draft preserved with controls restored.

Evidence

What I checked:

Likely related people:

  • steipete: Introduced the merged Cloud Workers profile editor and authored the prior Gateway page-lifecycle refactor in the affected history. (role: feature and adjacent lifecycle contributor; confidence: high; commits: 78beccf05397, 59cd041c37a9; files: ui/src/pages/cloud-workers/cloud-workers-page.ts, ui/src/lit/gateway-page-controller.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.

Copy link
Copy Markdown
Contributor Author

Land-ready verification

Reviewed exact head 0fcf0634559984d9d2302bf513f630f736bad8e0.

The repair releases the page-owned busyProfileId lease from the existing Gateway invalidator while preserving the editor/draft and retaining the captured-scope fence that keeps retired completions silent. Save and delete share the repaired owner.

Proof

  • Authentic pre-fix source-Chromium regression failed after reconnect at profileId.isEnabled(): expected true, received false, with the exact reconnect-proof / hetzner draft still mounted.
  • Post-fix Cloud Workers mocked-Gateway E2E: 4/4 passed, including deferred config.patch, same-client reconnect, preserved draft, recovered Save/Cancel/inputs, retired-completion silence, and exactly one fresh retry.
  • Cloud Workers config owner tests: 11/11 passed.
  • Exact changed-file gate passed formatting, UI/core-test typechecks, i18n verification, lint, dead exports, and policy guards.
  • Stable patch ID remained d421a539ec764cd0c3dfb7c3b96320c63f7f384d across the current-main rebase; focused proof passed again after rebase.
  • Independent high-mode complete-diff review found no P0-P3 issues and confirmed the page invalidator as the best owner boundary. The repository Codex autoreview helper's disclosed authentication failure is the reason for this substitute.
  • Exact-head CI is green: run 32473157538.
  • Agent-native OPENCLAW_TESTBOX=1 scripts/pr prepare-run 127150 completed successfully on the exact PR head.
  • ClawSweeper reviewed the exact head with no correctness/security findings and judged the fix best: durable review. Its live runner timed out waiting for output; the executed local E2E, exact-head CI, and Testbox prepare above cover that proof gap.
  • Inspected source-Chromium evidence: before / after.

ClawSweeper “Before merge” disposition

  1. Production net +1: accepted. Source is +4/-3; the sole semantic addition is the direct page-owner transition required to release the retired busy lease. An unconditional finally cleanup would violate stale-operation ownership, and no net-neutral refactor can absorb this distinct lifecycle transition.
  2. Exact-head CI / normal merge handling: complete; exact-head CI and native prepare are green.

ClawSweeper listed no rank-up moves. No config, protocol, persistence, permission, or public API contract changes.

@steipete
steipete merged commit 75c44b2 into main Aug 21, 2026
203 checks passed
@steipete
steipete deleted the codex/autoqa-cloud-workers-reconnect branch August 21, 2026 10:50

Copy link
Copy Markdown
Contributor Author

Merged via squash.

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. rating: 🐚 platinum hermit Good normal PR readiness with ordinary 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.

2 participants