Repository navigation
Description
Bug type
Behavior bug (incorrect output/state without crash)
Beta release blocker
No
Summary
The Control UI New session page can display “The Gateway changed while this session was starting” after the first message was accepted, without an observed reconnect, and then automatically open the already-running session.
Steps to reproduce
The observed flow used a fresh browser profile, opened New session, selected Local, and submitted a task. The Gateway accepted one sessions.create request. The page displayed the warning before navigating to that same running chat.
The timing is reproducible through the existing mocked-Gateway Control UI E2E boundary:
- Let the connection's hello arrive, but hold the browser's asynchronous recovery-scope hydration.
- Submit a local first message.
- Release hydration either while
sessions.createis awaiting its response, or after its accepted response while the chat module is still loading. - Observe the Gateway-change warning even though the test injected no reconnect.
The accompanying regression is in ui/src/e2e/new-session-page.workspace-validation.e2e.test.ts, “keeps a local start owned when recovery scope hydrates …”. With the new regression tests and original production files, both timings fail on the exact warning.
Expected behavior
The same authenticated connection should retain ownership of the submitted task while browser recovery initialization finishes. Once creation is accepted, the UI should open that session without a false Gateway-change warning. A real connection-owner or Gateway-process change must still fence unsafe replay.
This follows the documented New session behavior: https://docs.openclaw.ai/web/control-ui#new-session-page
Actual behavior
The recorded page showed:
The Gateway changed while this session was starting. Check recent sessions before starting this task again.
The recording contained one accepted UI sessions.create request and later opened the same running chat. Both controlled hydration timings displayed the same warning without an injected reconnect.
OpenClaw version
Observed runtime: 2026.8.1, source 3d23901f80c013d8ed36f2fa2c2651df5844a55f, build 2026.8.1-3d23901f80c0-2026-08-30T23-11-53.925Z.
Original-production regression tests: c29f34dc5312530761529e7133afa083911e7959. The affected startup owners were unchanged from the observed runtime and remained unchanged on pinned main 9f6d8c5a60b4ce251157e354b459d29037179f57.
Operating system
Deterministic reproduction: macOS 26.6.2, Node 24.20.0, Playwright 1.62.1.
Install method
Source checkout; the deterministic test uses the repository's bundled Control UI mocked-Gateway E2E harness.
Model
None required for the deterministic UI reproduction; no model request is made.
Provider / routing chain
Control UI → mocked Gateway WebSocket for deterministic proof. Provider execution is not needed to trigger this ownership race.
Additional provider/model setup details
NOT_ENOUGH_INFO
Logs
Original production, controlled recovery hydration before acceptance:
expected no draft error
received: The Gateway changed while this session was starting. Check recent sessions before starting this task again.
Original production, controlled recovery hydration during chat preparation:
expected no draft error
received: The Gateway changed while this session was starting. Check recent sessions before starting this task again.
Screenshots, recordings, and evidence
An inspected frame from the real before recording visibly contains the warning. Before/after media and verification of the real repaired flow remain pending; no media is attached to this report.
The recording subsequently encountered an independent completion-observer failure. It is evidence of the visible startup warning, not successful Swarm completion or repaired live behavior. The deterministic UI regression tests independently reproduce the warning.
Impact and severity
Affected surface: Control UI New session, including tasks whose first message starts delegated work. The page reports an unknown outcome while the accepted task is already running, directing the operator to check recent sessions instead of providing a trustworthy start result. The real warning was observed in one recording; the controlled ordering reproduces it at both startup boundaries deterministically.
Additional information
The owning draft state waits for browser recovery hydration to adopt an identity that the authenticated hello already supplied. It then treats that late initialization as an owner change. A related reconnect boundary can replay before a replacement principal's scope is adopted. Both paths share the same scope-binding owner; no provider-specific workaround is needed.
Current-main source check at 8249fd61a9183a14063278741093645f8f3b238f: the three affected ownership modules, startup/submission path, and relevant hello/authentication producers are unchanged from the reproduced baseline. Neighboring preference/persistence changes do not implement the scope repair.
Related, but distinct: #120953 (cloud-draft interruption/dead-end cleanup, fixed by #120970) addressed tab interruption and worker cleanup, not initial recovery hydration. #106372 (stale New session discovery after reconnect) is also closed and covers a different trigger. Archive-first discovery and live GitHub searches found no open duplicate of this race.
Last known-good release: NOT_ENOUGH_INFO.
Metadata
Metadata
Assignees
Labels
Type
Fields
Priority
Activity
clawsweeper commentedon Aug 31, 2026
Codex review: keeping this open for maintainer follow-up; there is still a little grit to resolve. Reviewed August 31, 2026, 12:39 AM ET / 04:39 UTC.
Summary
Keep this issue open: current main still delays recovery-scope binding until asynchronous post-hello work completes, and that later scope update is classified as a Gateway identity change. The formally linked open repair PR is the active fix path, while the
maintainerlabel requires explicit maintainer handling.Reproducibility: yes. Current source shows the asynchronous post-hello scope publication and the owner-change invalidation path; the report supplies the corresponding controlled E2E ordering, though this read-only review did not execute it.
Next step
An open PR formally linked to this issue already owns the bounded repair, and the protected maintainer label requires maintainer handling rather than another fix dispatch.
Review details
Best possible solution:
Land the linked owner-boundary repair after it proves that late same-connection recovery hydration preserves an accepted start while a changed Gateway boot or principal still fences replay.
Do we have a high-confidence way to reproduce the issue?
Yes. Current source shows the asynchronous post-hello scope publication and the owner-change invalidation path; the report supplies the corresponding controlled E2E ordering, though this read-only review did not execute it.
Is this the best way to solve the issue?
Yes. Binding the authenticated connection identity before asynchronous recovery restoration is the narrow owner-boundary repair, provided the existing true Gateway-process-change fence remains covered.
AGENTS.md: found and applied where relevant.
Remaining risk / open question:
Codex review notes: model internal, reasoning high; reviewed against 10f5ef53cdc1.
Label changes
Label justifications:
P1: A normal first-message Control UI workflow can report an unknown outcome after the Gateway accepted the request.impact:session-state: The defect is caused by session-start draft ownership and recovery scope state.impact:ux-friction: The UI warns operators to inspect recent sessions even though it subsequently opens the accepted session.Evidence reviewed
What I checked:
ui/src/pages/new-session/draft-gateway-state.ts:235, 10f5ef53cdc1)ui/src/api/gateway.ts:538, 10f5ef53cdc1)ui/src/pages/new-session/draft-submission-flow.ts:358, 10f5ef53cdc1)ui/src/e2e/new-session-page.workspace-validation.e2e.test.ts:475, 10f5ef53cdc1)ui/src/pages/new-session/draft-gateway-state.ts:216, ea806575e645)Likely related people:
How this review workflow works
@clawsweeper re-reviewcomments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.@clawsweeper re-reviewor@clawsweeper re-runon an open PR or issue to request a fresh review only.@clawsweeper reviewto request a fresh review only.@clawsweeper autofix,@clawsweeper automerge,@clawsweeper fix ci, or@clawsweeper address review.@clawsweeper explainto ask for more context, or@clawsweeper stopto stop active automation.fix(ui): avoid false Gateway-change warnings during session startup
fix(ui): avoid false Gateway-change warnings during session startup
fix(ui): avoid false Gateway-change warnings during session startup
fix(ui): avoid false Gateway-change warnings during session startup
fix(ui): avoid false Gateway-change warnings during session startup
fix: settle cancelled runs without ending cron retries early (opencla…
fix: settle cancelled runs without ending cron retries early (opencla…