Repository navigation
fix(ui): prevent Labs config refresh races - #119115
Conversation
|
@clawsweeper re-review Exact head: This is a one-file E2E synchronization repair for the twice-reproduced |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Codex review: needs real behavior proof before merge. Reviewed August 9, 2026, 7:47 AM ET / 11:47 UTC. ClawSweeper reviewWhat this changesThe PR removes the Labs page’s second configuration refresh after a setting patch and strengthens unit and browser coverage for the runtime-owned refresh. Merge readiness⛔ Blocked until stronger real behavior proof is added - 3 items remain Keep open: the patch is the correct Labs owner-boundary repair, but its inspected screenshots do not prove the claimed request/caller trace, so it still needs inspectable real-behavior evidence before merge. Priority: P3 Review scores
Verification
How this fits togetherControl UI settings send patches through the shared runtime configuration owner, which adopts Gateway acknowledgements or fetches a fresh snapshot for hash-only replies. Labs displays that shared state, and later settings writes rely on the resulting config hash. flowchart LR
A[Labs setting change] --> B[Runtime config patch]
B --> C{Gateway acknowledgement}
C -->|Config included| D[Adopt shared snapshot]
C -->|Hash only| E[Owner config refresh]
D --> F[Labs settings state]
E --> F
F --> G[Next guarded config write]
Before merge
Agent review detailsSecurityNone. PR surfaceSource -4, Tests +6. Total +2 across 3 files. View PR surface stats
Review metrics
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Attach an inspectable, redacted real-Gateway trace tied to the reviewed head that records no Labs-owned refresh and the following guarded write’s authoritative hash, then merge this narrow Labs fix; audit MCP, Skill Workshop, and Dreaming refresh callers separately. Do we have a high-confidence way to reproduce the issue? Yes—source establishes a hash-only patch acknowledgement whose owner refresh completes before Labs starts a redundant second refresh; the PR’s focused browser case exercises that sequence. Is this the best way to solve the issue? Yes for Labs: the shared runtime patch path already owns acknowledgement adoption and fallback refresh, so deleting the page-level duplicate is cleaner than adding synchronization at the consumer. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 5d98d2e6ecd7. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (10 earlier review cycles; latest 8 shown)
|
|
Addressed the current-head P2 synchronization finding in The test no longer uses the save indicator's initial All request, payload, conflict, reload, retry, and apply assertions remain unchanged. The repository formatter and @clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Exact-head target evidence is now available from Actions run 30880188743: No local or fabricated real-setup proof is claimed. The PR remains one E2E file with no production, timeout, config, credential, or user-data change. |
Let the runtime config patch owner complete its authoritative refresh instead of starting a second Labs-page refresh. Tighten unit and mocked browser coverage around the single refresh and visible settings state. Co-authored-by: ZYV5ge <[email protected]> Punchcard-Session: amber-workshop-workshop-36
4aa1a9a to
a8d8aa9
Compare
|
@clawsweeper re-review Exact head: The contributor branch now carries the reviewed owner-boundary repair. The PR body has been replaced with:
The branch is mergeable. It is behind only by unrelated current-main drift, so no rebase was performed. |
|
🦞👀 Command router queued. I will update this comment with the next step. |
|
@clawsweeper re-review Exact-head real Gateway and Chromium evidence is now independently inspectable The immutable bundle revision is |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
@clawsweeper re-review |
|
🦞👀 Command router queued. I will update this comment with the next step. |
|
Merged via squash.
|
Let the runtime config patch owner complete its authoritative refresh instead of starting a second Labs-page refresh. Tighten unit and mocked browser coverage around the single refresh and visible settings state. Punchcard-Session: amber-workshop-workshop-36 Co-authored-by: Vincent Koc <[email protected]>
Closes #119112.
What Problem This Solves
Fixes an issue where resetting a Labs setting could start a second caller-owned configuration refresh after the runtime configuration owner had already completed the patch lifecycle. That duplicate read could race route state and make the guarded configuration-write browser scenario intermittently miss its next
config.set.Why This Change Was Made
runtimeConfig.patch()is the authoritative owner: it adopts a config-bearing Gateway acknowledgement and performs the required fallbackconfig.getfor older hash-only acknowledgements. The Labs page now waits only forpatch()and does not start another refresh.The focused browser regression keeps the hash-only acknowledgement case, requires exactly one owner fallback refresh, verifies the Labs route remains active, and captures the resulting visible state.
Production LOC: +0/-4 (net -4) | Tests: +9/-3
User Impact
Labs setting changes now settle through one configuration owner instead of adding a competing page-level refresh. This changes no config schema, default, migration, dependency, authentication, credential, or public protocol surface.
Evidence
Exact head
a8d8aa95157d74297271ced259b6267ed72f2b99a19f455ce45e87006a5b1de345f755cc74f29b6bCo-authored-by: ZYV5ge <[email protected]>parses as a contiguous trailer.Punchcard-Session: amber-workshop-workshop-36parses and is attested by the existing campaign session.Focused deterministic proof
config.patchacknowledgement.config.get.Using default: Enabled.git diff --check, targeted formatting, and targeted lint passed..artifacts/control-ui-e2e/config-safe-write/00-labs-canonical-refresh.png44f13018051c97bee97018406695f67bdccffa4ab0f8b2a20efa7affe2fb10e3Real Gateway and Control UI proof
A separate isolated run used the repository's real in-process Gateway server, exact-head Vite Control UI source, and Chromium. It used a dummy loopback token with channels, providers, and external credentials disabled.
config.patchacknowledgement included authoritative config.Using default: Enabled.runtimeConfig.refresh()boundary recordedapp-shell-gatewayas the explicit refresh caller and recorded no call fromlabs-page.config.getrequests. This is not claimed as single-request proof: the assertion here is that Labs contributes no additional refresh.config.setused the runtime owner's final authoritative hash asbaseHash.Public, independently downloadable evidence:
050c58236e69f5942ed0e6f8df6e096b7b3d9acedd84cdd8b6330b7be6495f419159195499fa48988510a586091edfeaf3e03895906e849b14f734b237c0fc382be337ccd7d5c71ebac77a4a92bb1d343e8a4158df527e1c88438efa31f71fbd25ebf84b8475dda099ca9539577c341cd717b82fThe public raw files were downloaded without GitHub API authentication and
verified byte-for-byte against the scrubbed local bundle.
Current main
1471881af7aaff047c605dce08caa9a86f0de316.git merge-tree --write-treecompleted cleanly with treef66cea22972e3470834d7eec73b503fa35c62769.Unrelated linked-worktree check noise
The reported
packages/terminal-core/src/ansi.ts:194boundary-DTS failure is not caused by this change:packages/terminal-core/src/ansi.tsis byte-identical to current main (50c82d9609bf7273d4ad0eac7110766d00a71e66).packages/terminal-coredeclaresstring-width8.2.2, whose types accept the second options argument.string-width4.2.3, whose types accept only one argument.No terminal-core change belongs in this PR.
Follow-up Evidence
Three sibling callers still explicitly refresh after a successful
runtimeConfig.patch()and should be audited separately rather than widening this repair:ui/src/lib/config/mcp-servers.ts:227ui/src/pages/skill-workshop/self-learning.ts:71ui/src/pages/model-providers/config-mutation.ts:70AI Assistance
AI assistance was used for source/history inspection, the owner-boundary repair, focused validation, and evidence drafting. The exact diff, signed commit, real and mocked proof, and current-main merge-tree were independently reviewed.
Punchcard-Session: amber-workshop-workshop-36
Inline redacted real-Gateway receipt
{ "exactHead": "a8d8aa95157d74297271ced259b6267ed72f2b99", "proofKind": "real Gateway + exact-head Vite Control UI + Chromium", "isolatedState": true, "credentials": "dummy loopback token; no provider or channel credentials", "gateway": { "implementation": "src/gateway/server.ts via startGatewayWithClient", "patchAckIncludedConfig": true }, "controlUi": { "source": "exact-head ui/ source through Vite", "labsVisibleOutcome": "Using default: Enabled", "postPatchLifecycleConfigGets": 2, "explicitRefreshCallers": ["app-shell-gateway"], "labsIssuedExplicitRefresh": false, "guardedSetBaseHashMatchedOwner": true, "guardedSaveVisibleOutcome": "Code Mode override disabled", "pageErrors": [] }, "requestSequenceAfterLabsReady": [ "config.patch", "config.get", "agents.list", "config.get", "config.set", "config.get", "config.get", "agents.list" ] }Inline human-readable trace