Skip to content

fix(ui): avoid false Gateway-change warnings during session startup - #133789

Closed
steipete wants to merge 1 commit into
mainfrom
steipete/ui-session-start-hydration-task41
Closed

steipete wants to merge 1 commit into
mainfrom
steipete/ui-session-start-hydration-task41

Conversation

@steipete

@steipete steipete commented Aug 31, 2026 •

Copy link
Copy Markdown
Contributor

Closes #133785 (false Gateway-change warning during New session startup).

Additional instructions

MUST: Keep Allow edits from maintainers enabled for this PR so maintainers can help update the branch when needed.

What Problem This Solves

Fixes an issue where users starting a task from Control UI New session would see “The Gateway changed while this session was starting” when browser recovery initialization finished, even though the same connection had already accepted the task. The recorded flow later opened that same running chat, leaving the warning at odds with the task's actual state.

The same ownership timing also allowed a reconnect to replay a pending create before the replacement principal's recovery scope had been adopted.

Why This Change Was Made

The draft Gateway owner now binds its scope directly from the authenticated hello, while browser recovery readiness continues to gate saved-recovery restoration. Catalog eligibility reads that same canonical identity, so finishing browser migration neither invalidates a current start nor restarts authenticated catalog discovery; the redundant scope/profile projection helpers are removed.

This changes only Control UI ownership projection. It does not change server authentication, authorization, the idempotency ledger, configuration, protocol, persistence formats, or migration behavior. Existing Gateway URL, client, boot, and scope fences remain in place.

User Impact

Normal first-message startup stays busy and opens the admitted session without a false Gateway-change warning. Same-owner reconnects retain the frozen idempotent request; changed principals or Gateway processes remain fail-closed rather than replaying uncertain work. Folder, runner, model, and recovery behavior remain covered by the existing sibling tests. No new operator configuration is required.

Production LOC: +15/−48 (net −33). Tests and test support: +139/−37 (net +102).

Evidence

Refreshed source after the canonical CSS repair

Published refreshed source head: 2a0ab2b09a40bb36bbf6664e6f89c14e820246e1, based on f7f38bcc88a329a0b050a1ffa221496803ccf1ff. That main commit contains #133791 (rewind confirmation and CSS-selector repair), merged as 0ee6e0575a90f8c3fce8cd54e173d6b31b0923ef. Its final head was e3c93f8dd99130916e01252d748c371c9bf123ba; comparison with the previously inspected 84b2e4c99a296a519b4026bce87d4cd2db4420ec shows only deletion of one changelog line. The canonical three-file UI diff was inspected directly, and the CSS budget remains 54,784 B.

The refresh was a conflict-free standard rebase, with no source edits or hook suppression. git range-diff marks the Task41 commit equal, and stable patch-id remains d7fd0cb0163c147de9927311512ebd35365af242. The complete refreshed diff SHA256 is 7e4e43ce5c0ed917000d61cc4a3145d5bef555fe3f161310401fe97b74eae9d3; its different blob/header identity reflects the new base, not new repair logic. The ten-file scope and production/test LOC are unchanged. No additional managed review was run for this patch-identical mechanical refresh; the original review and explicit adjudication below remain preserved.

git rebase --onto f7f38bcc88a329a0b050a1ffa221496803ccf1ff c29f34dc5312530761529e7133afa083911e7959

The same unit and four-file E2E commands below were rerun on this head: 361 unit tests across 33 files and 35 browser E2E tests across 4 files passed. The complete ten-file changed gate and diff check also passed:

git diff --name-only -z f7f38bcc88a329a0b050a1ffa221496803ccf1ff HEAD | xargs -0 node scripts/check-changed.mjs --

The original commit, proof ledger, runtime metadata, and complete original UI bundle were preserved; all 1,191 original UI asset entries were reverified. The fresh canonical full build and subsequent standalone UI rebuild both completed with exit 0. The full build took 41m 57.3s, principally nine serialized runtime/declaration invocations; the final UI bundle built in 1m 33s. No declaration skip, budget increase, timeout override, or retry was used.

Fresh dist/build-info.json, AST-parsed UI metadata, and the service worker all match commit 2a0ab2b09a40bb36bbf6664e6f89c14e820246e1 and build ID 2026.8.1-2a0ab2b09a40-2026-08-31T05-49-40.341Z. All 1,188 new asset-manifest entries match their actual sizes and SHA256 digests; 792 precompressed sidecars verified. The largest CSS asset is 54,583 B gzip, under the unchanged 54,784 B limit; the complete performance report has no violations.

The UI's advisory dirty field is null, not a claim of dirty or clean source: its bounded Git reader explicitly permits unknown metadata (ui/vite.config.ts:153-159,225-233). Clean source and the unchanged complete patch were verified independently before and after building. The artifact verifier initially overrequired dirty=false; that unsupported assumption was corrected against the producer contract without relaxing commit/version/timestamp/build-ID or asset-hash checks. No product code or build bytes were changed to alter this metadata. These are fresh artifacts of the new commit, not restamped copies of the original build; the build-verification step alone was not live proof; the real-flow evidence below uses the refreshed build.

Replacement CI run 33365031747 completed successfully, attempt 1, on exact head 2a0ab2b09a40bb36bbf6664e6f89c14e820246e1. Its recorded main base is 9e444a9ea517f2a4004e7caae74a5f4284acdc52; GitHub computed merge 9ca35c9ab570981847177baff4f2d83bbc38e3eb. The single watcher exited 0 with SUCCESS, zero pending checks, and GREEN; structured run readback and the current PR head match. No watcher remains active, and the old failed watcher was not restarted. This is CI proof, not real repaired-flow or media proof.

Real rebuilt-Control-UI proof

The complete live-proof report now includes inspected before/after media and a continuous recording from the refreshed exact-head build. A fresh Chrome profile on an isolated Gateway completed one Start and one accepted create, opened the original session, displayed the exact requested synthetic reply, and returned to an idle composer without the false warning. No tools or children were produced.

The primary qualified run, startup-live-02, exited 0 in 36.47 seconds including setup/checks/cleanup. Its sole console error was the selected session's optional workspace-icon 404, paired with actual no-store and a visible fallback SVG; no unclassified console/HTTP errors or page exceptions remained. All 472 frames of the 18.88-second video were inspected. The browser/context and isolated Gateway were stopped; operator state was untouched.

Hydration was already ready at Start: this is normal real-flow proof, not a live delayed-hydration reproduction. Existing controlled browser regressions cover delayed hydration and changed-owner/process fencing. No timing manipulation or recovery-feature override was used. The visible repository badge references the separate public Swarm guidance checkout; runtime/UI identity was independently verified against this PR's 2a0ab2b09a40 build.

Before — observed false warning after an accepted start:

Before: false Gateway-change warning

After — original chat, exact reply, idle composer:

After: successful startup without the false warning

Complete recording:

task41-startup-complete.webm

Original reproduction and focused proof

The inspected before recording contains one accepted UI sessions.create request followed by the exact warning and later navigation to the running chat. That recording subsequently hit an independent completion-observer failure; it is not successful Swarm-completion evidence.

The new tests reproduce both warning timings by holding browser recovery hydration: before create acceptance, and after acceptance during chat preparation. No reconnect is injected into either case. On exact original production at c29f34dc5312530761529e7133afa083911e7959, all 6 targeted regressions failed for their intended reasons; after restoring the byte-identical repair, all 6 passed. Those cases also pin changed/missing handshake-owner replay fences and eliminate redundant hydration-triggered catalog fetches. Missing-owner hello injection is defensive wire-boundary coverage, not a claim that the current supported Control UI producer emits that state.

Full focused UI E2E: 35 passed across 4 files:

node scripts/run-vitest.mjs run --config test/vitest/vitest.ui-e2e.config.ts --configLoader runner ui/src/e2e/new-session-page.workspace-validation.e2e.test.ts ui/src/e2e/new-session-page.transition.e2e.test.ts ui/src/e2e/new-session-page.projects-places.e2e.test.ts ui/src/e2e/new-session-page.device-dispatch.e2e.test.ts

New-session units: 351 passed across 33 files:

node scripts/run-vitest.mjs ui/src/pages/new-session

Existing admission/browser identity contracts: 10 passed across 2 shards:

node scripts/run-vitest.mjs src/gateway/server/ws-connection/connect-policy.test.ts ui/src/lib/nodes/device-identity.insecure-context.test.ts

Existing build-admission, browser-client, and application-Gateway contracts: 139 passed across 3 files / 2 shards, including retained build identity on older-schema rejection:

node scripts/run-vitest.mjs ui/src/api/gateway.node.test.ts src/gateway/server/ws-connection/control-ui-build-admission.test.ts ui/src/app/gateway-store.test.ts

Before committing, the full changed-file gate and diff check passed for the ten-file candidate:

git diff --name-only -z | xargs -0 node scripts/check-changed.mjs --
git diff --check

Original completed build checkpoint

The original canonical full build followed by the final standalone UI rebuild completed with exit 0:

pnpm build
pnpm ui:build

The canonical full build's phase total was 5m 47.8s; the final UI bundle built in 4.38s, followed by successful precompression and performance checks (794 finalized sidecars verified).

After all runtime writers completed, the final UI rebuild reused the runtime identity. dist/build-info.json, the compiled UI metadata, and sw.js all contain build ID 2026.8.1-c29f34dc5312-2026-08-31T03-36-37.786Z. All 1,191 UI asset-manifest entries were verified against their actual sizes and SHA256 digests. The source patch hash remained unchanged before and after building. This is build/artifact proof, not a running-Gateway or live-provider result.

Review disposition

Fresh managed Codex review at P0 completed cleanly. The explicitly broader P2 pass returned one finding about an unbound device-placement hello. That finding was rejected after reading the complete producer chain: ordinary Control UI admission requires a device, and its sole device-less exception is trusted-proxy authentication with a required nonempty user principal already attached before hello (src/gateway/server/ws-connection/connect-policy.ts:81-92, src/gateway/auth.ts:239-253, src/gateway/server/ws-connection/connect-session.ts:418-432). The backend self-pairing exception is a different client id/mode and does not apply to Control UI. Insecure origins and blocked browser storage still mint a device identity.

The historical older-v4 promise in #121671 (trusted-proxy cloud recovery) was explicitly superseded by #124971 (one-install/one-version UI coupling) and clarified by #125108 (deliberate admission exemptions). All are included in stable v2026.8.1; the current and tagged admission sources match. The actual app always sends its build identity, and the older v2026.6.34 closed connect schema rejects that field before hello. The current browser no longer retries without it. Cross-origin, custom-root, and development version mismatch are explicitly unsupported, not hidden compatibility paths (ui/AGENTS.md:39-43). The lower-level legacy-scope test injects hello into a client without the application's build identity; it does not establish supported cross-version admission.

The raw P2 report remains findings/exit 1, not relabeled clean. Effective accepted/actionable findings: 0. No speculative hardening or authentication-policy changes were added. Separate cleanup follow-up: remove the obsolete older-v4 scope fallback/test under Gateway Coupling while preserving credential hashing required by current recovery migration.

Related history and source identity

Archive-first discovery and live checks found no open duplicate. #120953 (cloud-draft interruption/dead-end cleanup), fixed by #120970 (accurate interrupted-setup outcomes), concerned tab interruption and worker cleanup rather than this initial-hydration race. #106372 (stale New session discovery after reconnect) is also closed and covers a different trigger.

Original published source head: 934a1e72ea1b5d272e5b18f35d4d68d5967c31ab. The normal-hook commit contains exactly the tested ten-file patch over c29f34dc5312530761529e7133afa083911e7959: SHA256 1005400c3ee1c638d51e807e38cad0e9d98cb51aa970b87e8c9df596c50dd143 (stable patch-id d7fd0cb0163c147de9927311512ebd35365af242). The local build ran before that commit. Its artifacts were not restamped and intentionally retain the original base commit and dirty-build identity; source equivalence is established by the unchanged complete patch, not by pretending the build ran at the new commit.

Current-main comparison at 8249fd61a9183a14063278741093645f8f3b238f found the three production owners, startup/submission path, and relevant handshake/authentication producers unchanged. Neighboring preference/persistence refactors do not implement this repair; the only overlap among the ten touched files is a non-overlapping test change in draft-place-browser.test.ts. The earlier ten-path byte-identity comparison at 9f6d8c5a60b4ce251157e354b459d29037179f57 remains historical evidence, not a claim that every neighbor is unchanged today.

Remaining landing gates and prior CI history

Real repaired-flow and inspected before/after media proof are complete on the exact refreshed head. Exact-head CI is green; repository-native prepare/merge gates remain outstanding. Marking this PR ready after merge-ref computation was only the native CI attachment procedure, not a landing attestation.

  • Completed: inspected real-flow before/after media and video are linked above. The live startup proof is separate from controlled timing E2E and does not claim Swarm-completion or changed-owner live replay proof.

  • Replacement exact-head CI is green as recorded above; the original failed run 33357188954 is historical evidence, not reusable success. It tested merge 3f6ab7556c1bf3d786274fdaf9fad6f8185b68d5: Task41 head 934a1e72ea1b5d272e5b18f35d4d68d5967c31ab into main 10f5ef53cdc1619d9a8271c66c71ad6e83892934, not the bare locally built source. Four completed jobs stopped at the same largest-CSS gzip gate: 54,809 B versus 54,784 B (+25 B) — real-Gateway UI, build-artifacts, compact-small-29, and compact-small-27. Their tests never ran. Missing Discord proof files are consequential to the aborted build. The single watcher exited 15 while other jobs were still running; no retry or budget change was made.

    fix(ui): keep rewind confirmation controls accessible #133791 (rewind confirmation and theme-selector repair) has now merged as 0ee6e0575a90f8c3fce8cd54e173d6b31b0923ef, and the refreshed base above includes it. Its actual final head and canonical source were verified rather than assuming that earlier head 84b2e4c99a296a519b4026bce87d4cd2db4420ec was what landed. The earlier owner CI run 33357237325, including its passing build-artifacts and real-Gateway UI jobs against the same original main base, remains historical owner evidence only. It is not green CI for this PR. No competing CSS patch or budget increase was added; the demonstrated red-base failure is the reason for the mechanical refresh.

  • Complete the repository-native review/prepare/merge gates. The current execution environment cannot write the required native review artifacts; no alternative writer or landing bypass was used. This PR remains open and unmerged. CI and live proof belonging to another source candidate are not claimed here.

@clawsweeper

clawsweeper Bot commented Aug 31, 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: M maintainer Maintainer-authored PR labels Aug 31, 2026
@steipete
steipete marked this pull request as ready for review August 31, 2026 04:28
@steipete steipete self-assigned this Aug 31, 2026
@clawsweeper clawsweeper Bot added merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. P1 High-priority user-facing bug, regression, or broken workflow. 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 31, 2026
@clawsweeper

clawsweeper Bot commented Aug 31, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 2, 2026, 6:15 AM ET / 10:15 UTC.

ClawSweeper review

What this changes

The PR makes Control UI New session bind a pending start to the authenticated Gateway hello immediately, rather than treating later browser recovery hydration as a Gateway identity change.

Regression provenance

Possible regression — probable (reproduction; reviewed change). No predecessor PR is attributed.

Merge readiness

⚠️ Ready for maintainer review - 4 items remain

Keep open: current main and v2026.8.2 do not contain this repair, and the maintainer-owned PR remains a coherent fix. No introduced correctness finding was found; its stated integration into the open lifecycle PR still needs a maintainer landing decision before this standalone branch can be retired.

Priority: P1
Reviewed head: 5885cbcac88c23bbf42b7b492c0697af0752f26e
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, net-negative production repair with behavioral race coverage and no supported introduced correctness defect found.
Proof confidence 🌊 off-meta tidepool Not applicable: This is a maintainer-owned PR, so the external-contributor proof gate does not apply; the supplied record nonetheless describes a real isolated Control UI before/after run, while the delayed-hydration cases are covered by the introduced browser boundary tests.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This is a maintainer-owned PR, so the external-contributor proof gate does not apply; the supplied record nonetheless describes a real isolated Control UI before/after run, while the delayed-hydration cases are covered by the introduced browser boundary tests.
Evidence reviewed 7 items Current-main behavior: Fetched main still delays the draft recovery scope through resolveScope until client recovery hydration is ready, then treats the changed value as an owner change and invalidates the draft; the proposed repair is therefore not already on main.
Authoritative owner boundary: The Gateway creates an opaque recovery scope from authenticated principal or device material and places it in hello.auth; the PR reads that already-authenticated fact before the browser-side migration completes.
Introduced owner fix: The changed draft owner retains recoveryScopeReady only for restoration, while session-create fencing derives from Gateway URL, hello recovery scope, and boot ID.
Findings None None.
Security None None.

How this fits together

Control UI New session observes the Gateway connection snapshot to select a destination and start a session. The authenticated hello supplies the recovery owner, while asynchronous browser recovery later restores saved work under that owner.

flowchart TD
  A[Gateway hello] --> B[Control UI connection snapshot]
  C[Browser recovery hydration] --> D[Saved recovery restoration]
  B --> E[New session draft owner]
  E --> F[Session creation]
  E --> G[Gateway-change fence]
  D --> E
  F --> H[Running chat]
Loading

Decision needed

Question Recommendation
Should this standalone maintainer PR remain open as the proof record until the integrated lifecycle PR is verified and merged? Retain pending integrated landing: Keep this PR open as the focused reproduction record and merge only the verified integrated implementation before closing this branch as superseded.

Why: The author explicitly asks not to land this branch independently, while the claimed replacement remains open and its exact current patch could not be verified from the local checkout.

Before merge

  • Resolve merge risk (P1) - The change deliberately changes which authenticated recovery scope owns a pending start; a future integration must preserve the tested URL, boot-ID, and changed-principal fences.
  • Resolve merge risk (P1) - The linked integrated PR has not been locally verified to contain this exact patch, so this PR should not be closed or merged solely on the integration claim.
  • Complete next step (P2) - A maintainer should verify the integrated landing candidate before merging or retiring this standalone PR; do not land this branch independently.
Agent review details

Security

None.

PR surface

Source -33, Tests +104. Total +71 across 10 files.

View PR surface stats
Area Files Added Removed Net
Source 3 15 48 -33
Tests 7 147 43 +104
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 10 162 91 +71

Review metrics

Metric Value Why it matters
Production versus regression coverage production +15/-48 (net -33); tests/support +147/-43 (net +104) The owner-boundary repair simplifies production scope projection while adding explicit race and principal-change coverage.

Merge-risk options

Maintainer options:

  1. Use the integrated landing path (recommended)
    Verify that the integrated PR preserves the hello-owned scope and all owner-change fences before landing it, then close this focused branch as superseded.
  2. Land this branch independently
    Only choose this if the maintainer rejects the integration path and rechecks the exact standalone head's session-recovery behavior.

Technical review

Best possible solution:

Keep one verified implementation path: compare the integrated branch against this owner-boundary fix before landing it, then retire this standalone proof PR only after that branch merges.

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

Yes—source provides a high-confidence controlled browser reproduction that delays recovery hydration at both relevant startup points and checks the false warning plus duplicate-create fence; it was not executed in this read-only review.

Is this the best way to solve the issue?

Yes—the patch reads the Gateway-authenticated hello at the ownership boundary and leaves browser recovery readiness as the restoration gate, instead of adding a competing timing wait.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 3a6881df3172.

Labels

Label justifications:

  • P1: The defect can show an unknown Gateway outcome after the operator's first session start was accepted, encouraging an unnecessary duplicate attempt.
  • merge-risk: 🚨 session-state: The patch changes the authenticated owner key used to retain, restore, or fail-close a pending session start.
  • 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 a maintainer-owned PR, so the external-contributor proof gate does not apply; the supplied record nonetheless describes a real isolated Control UI before/after run, while the delayed-hydration cases are covered by the introduced browser boundary tests.

Evidence

What I checked:

  • Current-main behavior: Fetched main still delays the draft recovery scope through resolveScope until client recovery hydration is ready, then treats the changed value as an owner change and invalidates the draft; the proposed repair is therefore not already on main. (ui/src/pages/new-session/draft-gateway-state.ts:237, 3a6881df3172)
  • Authoritative owner boundary: The Gateway creates an opaque recovery scope from authenticated principal or device material and places it in hello.auth; the PR reads that already-authenticated fact before the browser-side migration completes. (src/gateway/server/ws-connection/connect-hello.ts:87, 5885cbcac88c)
  • Introduced owner fix: The changed draft owner retains recoveryScopeReady only for restoration, while session-create fencing derives from Gateway URL, hello recovery scope, and boot ID. (ui/src/pages/new-session/draft-gateway-state.ts:180, 5885cbcac88c)
  • Behavioral regression coverage: The introduced browser tests hold recovery hydration before create acceptance and during chat preparation, require one create and no warning, and separately retain fail-closed behavior for changed or missing owners and changed Gateway boots. (ui/src/e2e/new-session-page.workspace-validation.e2e.test.ts:424, 5885cbcac88c)
  • Main and release provenance: The PR head is not an ancestor of fetched main or stable v2026.8.2, so neither currently contains this repair. (5885cbcac88c)
  • Feature-history routing: Recent merged Control UI recovery and reconnect work is predominantly attributable to steipete; exact line-introduction blame could not be completed because this partial checkout attempted a promisor fetch and DNS was unavailable. (ui/src/pages/new-session/draft-gateway-state.ts:211, 4f0e131cd270)

Likely related people:

  • steipete: 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 (6 earlier review cycles)
  • reviewed 2026-08-31T04:40:43.119Z sha 934a1e72ea1b5d272e5b18f35d4d68d5967c31ab :: needs maintainer review before merge. :: none
  • reviewed 2026-08-31T04:48:01.255Z sha 934a1e72ea1b5d272e5b18f35d4d68d5967c31ab :: needs maintainer review before merge. :: none
  • reviewed 2026-08-31T06:49:39.989Z sha 2a0ab2b :: needs maintainer review before merge. :: none
  • reviewed 2026-08-31T07:25:28.531Z sha 2a0ab2b :: needs maintainer review before merge. :: none
  • reviewed 2026-08-31T10:48:41.790Z sha 2a0ab2b :: needs maintainer review before merge. :: none
  • reviewed 2026-09-02T08:24:14.550Z sha 2a0ab2b :: needs maintainer review before merge. :: none

@steipete
steipete force-pushed the steipete/ui-session-start-hydration-task41 branch from 934a1e7 to 2a0ab2b Compare August 31, 2026 06:38
@steipete

Copy link
Copy Markdown
Contributor Author

Real Control UI proof completed

The rebuilt Control UI at exact head 2a0ab2b09a40bb36bbf6664e6f89c14e820246e1 completed the normal first-message flow in a fresh Chrome profile against a task-owned, isolated Gateway. This addresses the real-flow evidence request in the latest review; the native prepare/merge workflow is still outstanding.

Before: the false warning was captured after an accepted start during the earlier synthetic Swarm probe. That earlier probe later failed its separate completion observer; this image proves the warning, not successful Swarm completion.

Before: false Gateway-change warning after an accepted session start

After: the fresh startup reached its original chat, displayed the exact requested reply, and returned to an idle composer without the warning.

After: original session displays its requested reply and idle composer

Complete recording:

task41-startup-complete.webm

The recorded run (startup-live-02, exit 0, 36.47 seconds including setup/checks/cleanup) verified:

  • One Connect click, one authenticated hello, one Start click, and exactly one accepted sessions.create; no authenticated reconnect, document reload, repeated Start, or Stop.
  • The accepted key/SID/run remained bound to the completed reply and committed chat. Bounded read-only confirmations found the exact terminal run, one matching assistant response, no tool messages, and no spawned children.
  • The warning latch stayed false; the composer became idle and enabled. No hydration delay, crypto hook, UI patch, or recovery-feature override was injected. Hydration was already ready at Start, so this is normal real-flow proof, not a live reproduction of the delayed-hydration race. The existing controlled E2E regressions cover delayed hydration and changed-owner/process fences.
  • The sole console error was correlated to this selected session's optional workspace-icon 404, with actual Cache-Control: no-store and a visible fallback SVG. There were zero unclassified console/HTTP errors and zero page exceptions. Default UI bootstrap requests were counted, not described as all read-only.

The browser/context closed, selected work was verified idle, and the parent stopped the isolated Gateway. No operator Gateway/state was touched. The earlier independent startup-live-01 also passed startup invariants, but its two unclassified console events remain unclassified; this new run does not retroactively assign their cause.

Runtime metadata, UI-announced build, Gateway hello, and the passively observed served UI asset matched 2026.8.1-2a0ab2b09a40-2026-08-31T05-49-40.341Z; served asset SHA256 321f2a7705ec2f0309795adf30c8c8d40be236bb89e5a66c7e11f06affdb42a0. The visible repository badge links the separate, already-public Swarm guidance repair from the parent proof checkout; it is not the runtime/UI build identity.

All 472 frames of the 18.88-second recording were inspected (455 exact distinct pixel states, all 29 contact sheets, plus full-resolution before/after and masked-token frames). Only synthetic data and already-public campaign references were visible. Video SHA256: 2f837e4bbc593c5b253e81e65f3b80c7402e5c61cba5d57ece95597db8c7ac91.

Executed private task-owned harness:

python3 .artifacts/task41/run-ui.py startup-live-02 --execute-ui=parent-authorized

The code is unchanged from the green exact-head CI run, 361-unit/35-browser-E2E proof, full changed gate, and fresh runtime/UI builds already recorded in the PR. The live/media gap is closed; this is not a claim that the PR has merged or that native landing gates have run.

@clawsweeper clawsweeper Bot added proof: 🎥 video Contributor real behavior proof includes video or recording evidence. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. labels Aug 31, 2026
@steipete

steipete commented Sep 2, 2026

Copy link
Copy Markdown
Contributor Author

I’m taking this through the native landing gates as the prerequisite for the Control UI startup-performance follow-up. The source check confirms that the authenticated hello owns the recovery identity; browser recovery readiness owns migration/restoration, not the lifetime of an admitted first turn. I’m retaining the URL, client, authenticated-scope, and process-boot fences rather than introducing a competing discovery-readiness wait.

Fresh owner/browser regression runs, an isolated build, and independent autoreview are in progress. The existing exact-head live recording and controlled delayed-hydration evidence remain linked in the PR; the new performance measurements will be reported separately and are not proof for this PR yet.

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Sep 2, 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

steipete commented Sep 2, 2026 •

Copy link
Copy Markdown
Contributor Author

Superseded by the landed lifecycle/startup integration #133747, merged as b057266d78d0 on September 2, 2026 at 12:38:32 UTC. Closing this standalone startup PR; its original reproduction and proof remain preserved here.

Verified against this PR's current head 5885cbcac88c23bbf42b7b492c0697af0752f26e: all three production owners and six of seven test/support files are byte-identical to the integrated candidate. The remaining E2E file adds accepted-session selection synchronization before Chat preparation; its only other difference is a variable/comment rename with unchanged expectations. All ten relevant files are unchanged between the tested integration head and the landed commit.

The canonical fix binds draft ownership to authenticated hello rather than late browser recovery hydration. Saved recovery still waits for readiness, and genuine process changes or changed/missing owners still prevent replay. Current exact-head proof, commands, and recordings cover the RED/GREEN hydration regressions, 429 UI tests, real same-owner recovery, real device-token rotation, and the explicitly disclosed missing-scope transport fault. Exact-head CI passed.

The startup-warning issue #133785 is already closed by the canonical merge. No independent landing of this branch is needed. This replaces the earlier pending-integration pointer after verifying the actual merge, not merely assuming it from a green test run.

@steipete

steipete commented Sep 2, 2026

Copy link
Copy Markdown
Contributor Author

Fresh maintainer verification

Accept the authenticated hello as the canonical pending-start owner, with the existing Gateway URL, client, authenticated-scope, and process-boot fences intact. Browser recovery readiness remains the migration/restoration boundary. This is the existing repair the startup-performance follow-up will build on, rather than adding a competing readiness wait.

The complete prerequisite was composed onto inspected main baseline 331d8a2265ff07d5db51e459c32d38c10fc7dc24 in a dependency-isolated checkout. All three changed production modules are byte-identical to PR head 2a0ab2b09a40bb36bbf6664e6f89c14e820246e1; current-main comparison at dceb4340677 found no intervening changes in the affected owners, submission flow, browser client, or hello producer. The new build is correctly identified as 2026.8.1-331d8a2265ff-2026-09-02T08-24-49.221Z, not represented as a whole-tree build at the older PR commit.

Fresh local proof passed:

  • 13,159 UI unit/browser tests across 844 files (the repository router selected the broader UI lanes).
  • 38 startup E2Es across four files, including hydration before acceptance/during Chat preparation, same-owner reconnect, changed or missing recovery owner, process restart, and catalog discovery.
  • Full build, 14m 24.5s; unchanged bundle budgets, no ineffective dynamic imports.
  • Fresh independent autoreview, scoped-clean at P0, no accepted/actionable findings. This is not an all-priority review certificate.
node scripts/run-vitest.mjs ui/src/pages/new-session ui/src/api/gateway.node.test.ts ui/src/app/gateway-store.test.ts
node scripts/run-vitest.mjs run --config test/vitest/vitest.ui-e2e.config.ts --configLoader runner ui/src/e2e/new-session-page.workspace-validation.e2e.test.ts ui/src/e2e/new-session-page.transition.e2e.test.ts ui/src/e2e/new-session-page.projects-places.e2e.test.ts ui/src/e2e/new-session-page.device-dispatch.e2e.test.ts
pnpm build

The attached 14.08-second recording uses a real isolated Gateway, real PTY, and local synthetic OpenAI-compatible provider. It verifies first-open terminal and reload restoration, keeps the focused terminal shortcut out of PTY input, creates one session, shows partial streaming, waits for the turn to settle, and reloads the completed history. A DOM observer recorded no false Gateway-change warning. Initial discovery now sends one projects.list and one environments.list, versus two each on the frozen baseline. Six screenshots and the full-duration contact sheet were inspected; the captured content is synthetic.

This live replay uses ordinary recovery timing. Delayed hydration and changed-owner/process timing are covered by the controlled browser E2Es, not claimed as live fault injection. The direct real-profile DevTools transport became unavailable after baseline inspection; this fresh replay is Playwright against a real Gateway, without a mocked Gateway protocol.

The refreshed ClawSweeper review at 2026-09-02 08:24 UTC has no actionable findings; its remaining maintainer decision is resolved by the ownership judgment above. Exact-head GitHub checks were 174 green/skipped, MERGEABLE/CLEAN. Native prepare/merge remains the final gate; this comment is not a merge claim. Production −33 LOC, tests/support +102 LOC; no schema, protocol, configuration, dependency, or changelog change.

Rebuilt Gateway retains the completed synthetic reply after reload

attachment-2743159005.webm

Bind draft ownership to authenticated hello before browser recovery hydration. Keep real owner and Gateway-process replay fences, and avoid redundant catalog discovery after hydration.

Fixes #133785.
@steipete
steipete force-pushed the steipete/ui-session-start-hydration-task41 branch from 2a0ab2b to 5885cbc Compare September 2, 2026 10:06
@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. and removed proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. proof: 🎥 video Contributor real behavior proof includes video or recording evidence. labels Sep 2, 2026
@steipete

steipete commented Sep 2, 2026 •

Copy link
Copy Markdown
Contributor Author

Refreshed startup proof; integrated landing retained

I found the canonical integration handoff in the latest review and have stopped the independent landing path. This PR remains open as the focused proof record for the integrated lifecycle repair; I will not merge or close it independently of that integration decision.

The standalone source has now been refreshed to 5885cbcac88c23bbf42b7b492c0697af0752f26e, preserving the production repair and adapting its tests to the newer pending-start UI. Fresh exact-head CI passed. The old-head CI timeouts reached cold provider loading during error classification; this refresh includes the existing main-owned loaded-hook fixes rather than adding retries or raising timeouts.

Final local proof on the refresh: all 38 startup browser tests, three terminal lifecycle tests, and the complete changed-file checks passed. The focused backend integration lane passed 1,250 tests. Two initially over-broad draft-retention assertions were corrected from the persistence owner: a same-owner process restart keeps its draft, while a changed or missing principal must clear the previous owner's prompt. The final startup run passed all cases. Independent autoreview was scoped-clean at P0, not an all-priority certification. A fresh pnpm ui:build also passed unchanged budgets.

I also fetched integrated head 513bbb9f9a36a496cca5ce50d2bee025f7968fa4 and compared all ten startup-repair paths with this refreshed head. All three production owners and six of the seven test/support files are byte-identical. The remaining browser test preserves the same assertions, adds an explicit accepted-session-selection wait during Chat preparation, and renames the local expected-message variable/comment. The URL, boot, changed/missing-principal, and exactly-one-create fences are retained.

The previous inspected real-Gateway recording and source-qualified proof remain available. They cover initial discovery, real PTY restoration and shortcut handling, accepted creation, streaming through explicit idle settlement, absence of the false owner warning, and history reload; they are not relabeled as a whole-tree live build of this refreshed commit.

This is a handoff of additional verified evidence, not approval of the integrated PR's entire lifecycle patch or a claim that either PR has merged. The separate startup-performance follow-up will preserve this authenticated-hello boundary and the newer pending-start presentation.

@steipete steipete closed this Sep 2, 2026
steipete added a commit that referenced this pull request Sep 2, 2026
Keep phone formatting and transcript-only styles out of New Session startup. Bind token-free presentation preferences to the mounted Gateway, carry them through composer renders, and suppress unchanged agent publications. Reuse the canonical authenticated-hello recovery owner from #133789 and retire stale discovery tasks synchronously.

Proof: isolated full build and changed-file checks, focused preference/discovery tests, 93-state CSS parity, real Gateway PTY/create/stream/settle/history flow, and independent P0-scoped autoreview. The final broad suites and matched timing measurements remain in progress before publication.
steipete added a commit that referenced this pull request Sep 2, 2026
Keep phone formatting and transcript-only styles out of New Session startup. Bind token-free presentation preferences to the mounted Gateway, carry them through composer renders, and suppress unchanged agent publications. Reuse the canonical authenticated-hello recovery owner from #133789 and retire stale discovery tasks synchronously.

Proof: isolated full build and changed-file checks, focused preference/discovery tests, 93-state CSS parity, real Gateway PTY/create/stream/settle/history flow, and independent P0-scoped autoreview. The final broad suites and matched timing measurements remain in progress before publication.
steipete added a commit that referenced this pull request Sep 2, 2026
…6362)

* perf(ui): streamline startup runtime ownership

Keep phone formatting and transcript-only styles out of New Session startup. Bind token-free presentation preferences to the mounted Gateway, carry them through composer renders, and suppress unchanged agent publications. Reuse the canonical authenticated-hello recovery owner from #133789 and retire stale discovery tasks synchronously.

Proof: isolated full build and changed-file checks, focused preference/discovery tests, 93-state CSS parity, real Gateway PTY/create/stream/settle/history flow, and independent P0-scoped autoreview. The final broad suites and matched timing measurements remain in progress before publication.

* test(ui): preserve pending session titlebar insets

Assert that the pending Chat classes preserve New Session scroll padding across the existing viewport, theme, and motion matrix. Browser CSSOM checks on the reviewed build and baseline confirm the shared stylesheet precedes New Session overrides; no production cascade change is needed.

* test(gateway): publish RPC fixture config before yielding

Keep mutable testState agent entries in the pinned snapshot before real-IO readers or admitted runs can observe an RPC refresh. Extend the managed-worktree case with the observed interleaving, preserving agent validation and initial/follow-up cwd assertions. Controlled original-order proof fails before the helper repair and passes all 314 cases afterward.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 3, 2026
…nclaw#136362)

* perf(ui): streamline startup runtime ownership

Keep phone formatting and transcript-only styles out of New Session startup. Bind token-free presentation preferences to the mounted Gateway, carry them through composer renders, and suppress unchanged agent publications. Reuse the canonical authenticated-hello recovery owner from openclaw#133789 and retire stale discovery tasks synchronously.

Proof: isolated full build and changed-file checks, focused preference/discovery tests, 93-state CSS parity, real Gateway PTY/create/stream/settle/history flow, and independent P0-scoped autoreview. The final broad suites and matched timing measurements remain in progress before publication.

* test(ui): preserve pending session titlebar insets

Assert that the pending Chat classes preserve New Session scroll padding across the existing viewport, theme, and motion matrix. Browser CSSOM checks on the reviewed build and baseline confirm the shared stylesheet precedes New Session overrides; no production cascade change is needed.

* test(gateway): publish RPC fixture config before yielding

Keep mutable testState agent entries in the pinned snapshot before real-IO readers or admitted runs can observe an RPC refresh. Extend the managed-worktree case with the observed interleaving, preserving agent validation and initial/follow-up cwd assertions. Controlled original-order proof fails before the helper repair and passes all 314 cases afterward.
@RomneyDa
RomneyDa deleted the steipete/ui-session-start-hydration-task41 branch October 22, 2026 00:25
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 merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. P1 High-priority user-facing bug, regression, or broken workflow. 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.

[Bug]: New session reports a Gateway change after its first message was accepted

1 participant