Repository navigation
fix(ui): keep Gateway place labels current - #131118
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 27, 2026, 4:52 PM ET / 20:52 UTC. ClawSweeper reviewWhat this changesThe PR makes New Session derive Gateway folder-browser labels from current discovery state so labels refresh after delayed recovery or system information. Regression provenancePossible regression — suspected (reviewed change). No predecessor PR is attributed. Merge readinessKeep open: current main still has the mutable Gateway-name mirror and captured browser label that this PR removes; the focused repair is coherent and remains necessary. Priority: P2 Review scores
Verification
Live VerificationEntry: Result: PASS (completed) Steps:
Recorded live on the PR head ( How this fits togetherThe Control UI’s New Session page discovers the connected Gateway’s machine identity and uses it in destination and folder-browser labels. Gateway state feeds the discovery owner, then the project picker and folder browser render the current label. flowchart LR
Gateway[Connected Gateway]
Discovery[Machine-name discovery]
State[New Session state]
Picker[Project picker]
Browser[Folder browser]
User[Operator]
Gateway --> Discovery --> State
State --> Picker
State --> Browser
Picker --> User
Browser --> User
Before merge
Agent review detailsSecurityNone. PR surfaceSource -14, Tests +148, Docs +1. Total +135 across 10 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: 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: Land the single-owner state simplification after exact-head UI validation completes; do not restore separate mutable Gateway-label state. Do we have a high-confidence way to reproduce the issue? Yes: the focused controlled ordering tests provide a high-confidence reproduction path, and fetched main still contains both state patterns the tests target. Is this the best way to solve the issue? Yes: keeping identity in its discovery Task and deriving the browser label at render time removes the duplicate state responsible for both races. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 34246333609c. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
bb619d2 to
d177cff
Compare
|
Merged via squash.
|

What Problem This Solves
Fixes two New Session races that leave the Gateway displayed as
Gateway · localeven after its machine name was discovered: late recovery initialization can erase the name, and an already-open folder browser can retain an old label. The first symptom surfaced in an unrelated test-only PR's hosted browser job; controlled Chromium tests reproduce both ordering failures on current main.Why This Change Was Made
The discovery Task now owns the machine name directly. Its completed value survives unrelated recovery-scope initialization, while pending discovery hides an old connection's value and Task cancellation/call ordering rejects retired responses. This removes the separately mutable name field and completion callback.
The folder browser now stores only its open state. Its label comes from the current render rather than a captured
BrowserTargetobject. The unused node ID and target type are removed; the group-defaults dialog, the only other browser-renderer caller, keeps its existing generic Gateway label. Directory browsing, selection, request retirement, permissions, and session placement are unchanged.Production: +23/-37 (net -14). Tests: +199/-51. Changelog: +1. No dependency, configuration, protocol, persistence, or compatibility surface is added.
Alternatives rejected: adding recovery scope to name-discovery arguments would refetch to compensate for duplicated state, and updating captured labels on every metadata event would create another synchronization path. Reading the existing owner and deriving presentation at render time removes both failure modes.
Provenance: the name mirror was carried forward by draft-owner extraction #122413 (
6b0be0215fb8f54bf55b0a36b85678b16d7b096b, August 12 UTC). The captured browser label is blamed to #126187 (80934e5639d424b1a9ffda6e88726218d2ac5276, August 19 UTC). The original machine-identity feature was #112162 (dd6e366d94bce56c986a4e88ae42dcec2129be7a, July 21 UTC). All three PRs were authored and merged by @steipete; this identifies the exact current patterns, not necessarily the first appearance of each race. The affected paths are unchanged between the earlier fixture baseline and this PR's main baseline5890806fbe5688cebf4b713e0580e98e7a6b1958.User Impact
New Session keeps the advertised Gateway machine name when recovery setup completes. Browse folders updates its label if discovery completes while it is open. Reconnects and replacement clients still hide retired names until their own discovery finishes. The generic local label remains when discovery is unadvertised or unavailable.
The changelog follows the maintainer's explicit instruction to include release notes for user-visible fixes, a scoped exception to the release-owned changelog workflow.
Evidence
Gateway · localinstead ofGateway · QA-Gateway. One delays the actual recovery-scope digest until discovery completes; the other holds the actualsystem.inforesponse until Browse is open.cad34e612f0d23db922191f1f4be5c7248de97e9), incorporated by the mechanical rebase onto79dfa81664fd64a3f6192331af4953ff9f9bf1ef. The canonical config-documentation check passed on that baseline. This PR changes neither baseline nor budget; its refreshed complete changed-file gate passes.Resolved integration follow-up: #121554 added the Daytona manifest without refreshing the plugin documentation baseline. Main #131128 refreshed the canonical artifacts; no workaround is included here.
Before: an empty folder path still shows the generic local label after successful name discovery.
After: the same open browser uses the discovered name.
Captures contain synthetic QA data only. This is deterministic Chromium/mock-Gateway evidence, not authenticated live-profile proof.
Final landing verification
The earlier Chrome connection blocker is cleared through the supported Chrome connection; no browser access policy was changed. On exact head
d177cff9a33af89b0ecbe1c261a96ed522da2202, real Chrome passed both controlled timing sequences against the explicitly synthetic Gateway: releasingsystem.infowhile Browse was already open changed its placeholder fromGateway · localtoGateway · QA-Gateway; releasing recovery scope after discovery retained that name without a secondsystem.infocall. Disconnect/reconnect advanced discovery from one to two requests and restored the correct name. These are real-profile UI interactions with controlled mock transport, not a claim that the mock is a real Gateway.Exact-head CI run 33114840863 completed successfully, including all UI browser shards. Refreshed owner tests passed 26/26; complete changed-file gate passed. Structured Codex review has no actionable findings at its configured P0 threshold, and independent owner review found no correctness issue. Rebase is patch-identical by range-diff.
Latest ClawSweeper review on this exact head has no findings. Its dependency-source gap is resolved by direct inspection of installed
@lit/task1.0.3development/task.js: argument comparison/host update (151–192), run call-ID and completion publication (205–278), and abort semantics (282–306), together with the OpenClaw owner's disconnect retirement. Its CI gap is now green. The stored-data warning is not applicable: the group-defaults diff removes only a transient closure-localBrowserTarget; serialized defaults are unchanged. No migration is needed. A supplementary real-Gateway connection succeeded, but its New Session navigation hit a browser-control timeout; it is not counted as ordering proof. The completed controlled real-Chrome cases and exact-head browser CI above are the ordering proof.Named follow-up: the supplemental combined source-Gateway/Vite harness later became CPU-busy and did not complete graceful shutdown. Its exact cause is unproven and is not attributed to this label change. Only that isolated task process was force-stopped; its child, test-state directory and loopback listeners were verified removed. The operator's managed Gateway was untouched. Preserve this harness/lifecycle observation for a separate reproduction; do not count that attempt as passing backend proof.
Related: #131052 repairs serialized unit-fixture lifetime, not these product races. Its original browser assertion passed three focused repeats, but the controlled orderings above reproduce the baseline defects deterministically. This PR does not weaken that assertion or raise its timeout.