Skip to content

fix(ui): keep Gateway place labels current - #131118

Merged
steipete merged 1 commit into
mainfrom
codex/qa-gateway-place-label-owner-20260827
Aug 27, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/qa-gateway-place-label-owner-20260827

Conversation

@steipete

@steipete steipete commented Aug 27, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes two New Session races that leave the Gateway displayed as Gateway · local even 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 BrowserTarget object. 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 baseline 5890806fbe5688cebf4b713e0580e98e7a6b1958.

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

  • Authentic current-main Chromium RED: both controlled orderings fail with Gateway · local instead of Gateway · QA-Gateway. One delays the actual recovery-scope digest until discovery completes; the other holds the actual system.info response until Browse is open.
  • Authentic owner RED: the discovered-name retention test fails before the production repair, with nine other cases passing.
  • GREEN: 26 focused owner/rendering tests across three files and 26 Chromium scenarios across three files pass. Coverage includes project browsing/registration, group defaults, client replacement, same-client reconnect, late retired responses, advertisement removal, hostname fallback, and failed discovery.
  • The two controlled browser scenarios pass again after independent review's context-teardown feedback. Browser capture failure now still closes the context. Unit fixtures explicitly retire their owners.
  • Direct source proof includes both browser callers and the installed Lit Task lifecycle: host-update argument comparison, pending status, request call IDs, abort handling, completion publication, and disconnect retirement. Independent review found no production issue.
  • The final nine-UI-file changed gate passes, including core-test/UI types, type-aware lint, formatting, i18n, dead exports, and ownership/baseline ratchets. Its first run caught two missing braces in test code; corrected, then the owner file passed all 10 tests again. Final structured Codex review is clean at its configured blocking threshold.
  • The earlier changelog-triggered gate exposed a pre-existing config-documentation baseline mismatch. This is now resolved on main by feat(channels): add Matrix and LINE join introductions #131128 (cad34e612f0d23db922191f1f4be5c7248de97e9), incorporated by the mechanical rebase onto 79dfa81664fd64a3f6192331af4953ff9f9bf1ef. 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.

Before: open browser retains the generic Gateway label

After: the same open browser uses the discovered name.

After: open browser reflects the current Gateway 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: releasing system.info while Browse was already open changed its placeholder from Gateway · local to Gateway · QA-Gateway; releasing recovery scope after discovery retained that name without a second system.info call. 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.

Real Chrome: discovered name survives delayed recovery publication

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/task 1.0.3 development/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-local BrowserTarget; 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.

@steipete steipete added the app: web-ui App: web-ui label Aug 27, 2026
@clawsweeper

clawsweeper Bot commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@steipete steipete self-assigned this Aug 27, 2026
@openclaw-barnacle openclaw-barnacle Bot added size: M maintainer Maintainer-authored PR labels Aug 27, 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 Aug 27, 2026
@clawsweeper

clawsweeper Bot commented Aug 27, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 27, 2026, 4:52 PM ET / 20:52 UTC.

ClawSweeper review

What this changes

The PR makes New Session derive Gateway folder-browser labels from current discovery state so labels refresh after delayed recovery or system information.

Regression provenance

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

Merge readiness

⚠️ Ready for maintainer review - 3 items remain

Keep 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
Reviewed head: d177cff9a33af89b0ecbe1c261a96ed522da2202

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) The patch is a focused, net-negative owner-boundary repair with concrete focused coverage and no identified correctness finding.
Proof confidence 🌊 off-meta tidepool Not applicable: This MEMBER-authored PR is exempt from the external-contributor proof gate; inspected images are illustrative but do not specifically prove the two race orderings.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This MEMBER-authored PR is exempt from the external-contributor proof gate; inspected images are illustrative but do not specifically prove the two race orderings.
Evidence reviewed 6 items Canonical owner repair: The name now comes directly from the discovery Task only after completion, so recovery-scope catalog work cannot clear a separately mutable display value.
Render-time label: The project picker passes the current Gateway label when rendering an open browser rather than preserving a label captured when Browse was clicked.
Regression coverage: Focused tests cover delayed recovery, reconnect, client replacement, advertisement removal, and late system-information delivery; the browser E2E test directly waits for the updated placeholder.
Findings None None.
Security None None.

Live Verification

Entry: /new

Result: PASS (completed)

Steps:

  • PASS wait_for #new-session-project-trigger
  • PASS click #new-session-project-trigger
  • PASS expect_text Browse folders
  • PASS click [data-value="browse"]
  • PASS wait_for input.new-session-page__browser-path

Live proof recording

Recorded live on the PR head (d177cff9a33a), 10.56s, browser surface.

How this fits together

The 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
Loading

Before merge

  • Resolve merge risk (P1) - Exact-head repository validation is still in progress, so merge readiness cannot yet be inferred from the current check rollup.
  • Resolve merge risk (P1) - The worktree has no installed @lit/task source and network resolution failed, so the Task lifecycle contract cited by the PR was not independently rechecked from dependency source.
  • Complete next step (P2) - No mechanical repair is identified; await normal exact-head validation and maintainer review.
Agent review details

Security

None.

PR surface

Source -14, Tests +148, Docs +1. Total +135 across 10 files.

View PR surface stats
Area Files Added Removed Net
Source 7 23 37 -14
Tests 2 199 51 +148
Docs 1 1 0 +1
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 10 223 88 +135

Review metrics

Metric Value Why it matters
Production versus test delta production -14, tests +148, changelog +1 The bug fix removes duplicated production state while adding focused race and lifecycle coverage.

Stored data model

Persistent data-model change detected: serialized state: ui/src/components/session-group-defaults-dialog.ts. Confirm migration or upgrade compatibility proof before merge.

Root-cause cluster

Relationship: canonical
Canonical: #131118
Summary: This PR is the active repair for the two Gateway-label races; the related fixture-lifetime repair is distinct.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Land the single-owner state simplification after exact-head UI validation completes; do not restore separate mutable Gateway-label state.
  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 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.

Labels

Label changes:

  • add proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence. This MEMBER-authored PR is exempt from the external-contributor proof gate; inspected images are illustrative but do not specifically prove the two race orderings.

Label justifications:

  • P2: This is a bounded Control UI correctness repair with limited user-facing blast radius.
  • 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 MEMBER-authored PR is exempt from the external-contributor proof gate; inspected images are illustrative but do not specifically prove the two race orderings.
  • proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence. This MEMBER-authored PR is exempt from the external-contributor proof gate; inspected images are illustrative but do not specifically prove the two race orderings.

Evidence

What I checked:

Likely related people:

  • steipete: Current blame and local history connect this contributor to the New Session draft-owner code and the machine-identity feature lineage. (role: original feature/refactor author and recent area contributor; confidence: high; commits: d177cff9a33a, 6b0be0215fb8, dd6e366d94bc; files: ui/src/pages/new-session/draft-gateway-state.ts, ui/src/pages/new-session/draft-place-browser.ts, ui/src/pages/new-session/project-chip.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.

History

Review history (1 earlier review cycle)
  • reviewed 2026-08-27T18:41:17.576Z sha bb619d2 :: needs maintainer review before merge. :: none

@steipete
steipete marked this pull request as ready for review August 27, 2026 20:41
@steipete
steipete force-pushed the codex/qa-gateway-place-label-owner-20260827 branch from bb619d2 to d177cff Compare August 27, 2026 20:45
@clawsweeper clawsweeper Bot added the proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. label Aug 27, 2026
@steipete
steipete merged commit c7f1699 into main Aug 27, 2026
123 checks passed
@steipete
steipete deleted the codex/qa-gateway-place-label-owner-20260827 branch August 27, 2026 21:19
@steipete

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. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. 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