Repository navigation
fix(ui): keep header and composer visible during session startup - #166865
Conversation
Keep the header, disabled composer, and submitted prompt in the shared chat layout until admission, without starting session-scoped controllers. Preserve saved splits, incognito, and recovery behavior. Co-authored-by: steipete <[email protected]>
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. Reviewed October 7, 2026, 9:53 PM ET / October 8, 2026, 01:53 UTC (Revision 2). ClawSweeper reviewWhat this changesThe startup preview reuses the chat header, conversation layout, and disabled composer while preserving session admission and draft recovery. Example: The user submits “start the synthetic thread” on mobile.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review This PR remains useful: current main still loses the header and composer during startup. Both previous findings are resolved, the inspected visual proof supports the fix, and no actionable defect remains. Priority: P2 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherThe Control UI previews a submitted conversation while the Gateway confirms session creation. After confirmation, it hands the conversation to the normal chat view; rejection restores the original draft. flowchart TD
A[User submits a draft] --> B[Existing session creation owner]
B --> C[Read-only startup preview]
C --> D[Shared header and disabled composer]
B --> E{Gateway confirms creation}
E -->|Accepted| F[Normal chat view]
E -->|Rejected| G[Restored draft and attachments]
Technical reviewBest possible solution: Keep one shared chat presentation path while the existing creation owner controls admission, recovery, and the transition to interactive chat. Do we have a high-confidence way to reproduce the issue? Yes: submit a prompt while sessions.create is delayed; current main's preview omits the header and composer, matching the inspected before screenshot. No reviewer-side runtime execution was performed. Is this the best way to solve the issue? Yes: reusing the existing chat layout and disabled composer is a focused repair that preserves admission, attachment custody, and saved-layout ownership. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against b5c9a25685ff. Provenance checked
TestingProof path: shipped entry point. Added test files: 4. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +113, Tests +81. Total +194 across 11 files. View PR surface stats
Review metrics
LabelsLabel changes:
Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReview history (1 earlier review cycle)
|
Keep announcement, prompt custody, retry, and disabled-mutation checks across the shared pending layout. Co-authored-by: steipete <[email protected]>
|
Merged via squash.
|
…nclaw#166865) * fix(ui): keep chat chrome visible during session startup Keep the header, disabled composer, and submitted prompt in the shared chat layout until admission, without starting session-scoped controllers. Preserve saved splits, incognito, and recovery behavior. Co-authored-by: steipete <[email protected]> * test(ui): align startup recovery coverage with retained chrome Keep announcement, prompt custody, retry, and disabled-mutation checks across the shared pending layout. Co-authored-by: steipete <[email protected]> --------- Co-authored-by: steipete <[email protected]>
The mobile drawer slides its New conversation control beneath the stationary mouse pointer. Its tooltip can then correctly consume Escape before the drawer handler, making the pending-session test fail on aria-expanded. Move the pointer outside the drawer before exercising its single Escape. The existing open assertion still runs after the move. Keep every admission, URL, history, layout, and recovery assertion intact. The fixture added in da08dc8 (#166865) has this race on both the presumed good head 7b41658 and proof base 0363122. The reported favicon, locale, and SQLite commit window is not required to reproduce it. No production behavior changes. Validation: Linux historical/current negative controls; 20 pressured full-file copies (300 passed, no skips); the original 84-file CI shard three times (425 passed per run); full mocked UI E2E config (673 files, 3189 passed); check-changed, boundary lint, UI/test types, formatting, and P2 autoreview. Fresh-base replay after integrating 4821885: 15 passed, zero skips. The broader UI unit/browser run had 22540 passing tests, one unchanged clipboard-feedback failure, and six configured skips. This E2E file is excluded from that config. A focused unchanged tooltip probe passed all 13 cases; the original broader-run failure remains recorded separately.
The mobile drawer slides its New conversation control beneath the stationary mouse pointer. Its tooltip can then correctly consume Escape before the drawer handler, making the pending-session test fail on aria-expanded. Move the pointer outside the drawer before exercising its single Escape. The existing open assertion still runs after the move. Keep every admission, URL, history, layout, and recovery assertion intact. The fixture added in 68cda1d (openclaw#166865) has this race on both the presumed good head c5c5645 and proof base acd48d0. The reported favicon, locale, and SQLite commit window is not required to reproduce it. No production behavior changes. Validation: Linux historical/current negative controls; 20 pressured full-file copies (300 passed, no skips); the original 84-file CI shard three times (425 passed per run); full mocked UI E2E config (673 files, 3189 passed); check-changed, boundary lint, UI/test types, formatting, and P2 autoreview. Fresh-base replay after integrating 41b4900: 15 passed, zero skips. The broader UI unit/browser run had 22540 passing tests, one unchanged clipboard-feedback failure, and six configured skips. This E2E file is excluded from that config. A focused unchanged tooltip probe passed all 13 cases; the original broader-run failure remains recorded separately.
## Problem Open a brand-new main chat (no messages yet, for example right after onboarding sets a model). Session Details shows a red "Session process access changed; refresh the conversation." with Retry until the first reply arrives. The Gateway log shows three refused reads for the same chat: - `sessions.processes.list` → `FORBIDDEN` "Session process access changed; refresh the conversation." - `mcp.app.discover` → `FORBIDDEN` "The requested session is unavailable; open an existing session first." - `talk.catalog` → `INVALID_REQUEST` "No session found: agent:main:main" A config hot reload is not needed: a fresh profile with a model already configured shows the same three refusals.  ## Root cause The agent's main conversation has no session row until its first turn creates it. The chat still starts session-scoped reads for it on open: - Session Details reads processes as soon as it renders (`ui/src/pages/chat/chat-pane-layout-render.ts:293`, process Details since #175041). The Gateway has no row to bind the list to and answers with the access-changed error (`src/gateway/server-methods/session-processes.ts:69-79`, since #164061). - The composer mounts MCP discovery for the chat. The composer already has a `sessionAdmitted` gate for provisional sessions (`chat-composer-view.tsx:414`, #166865), but the chat pane never set it. Discovery needs a session authority, which needs a row (`src/gateway/session-access-authority.ts:246`). - The composer reads the session-scoped Talk catalog. The catalog only uses the key to pick the agent, but `talk.catalog` refused the missing row (`src/gateway/talk/handlers/catalog.ts:536`). Subscriptions already admit the caller's own unstarted main conversation (`isStartableMainSession`, #197151). v2026.11.6 has the same chat pane and process code. ## Fix Each reader is fixed at the owner of the fact it depends on: | Read | Depends on | Owner and fix | |---|---|---| | `sessions.processes.list` | the row's `sessionId` | Control UI: Details stops offering process reads once the chat's history read proved the session absent (`isChatSessionProvenAbsent`, #197151). A cold load of an existing chat keeps its Details layout while rows load. | | `mcp.app.discover` | a session authority built from the row | Control UI: the chat pane sets the composer's existing `sessionAdmitted` gate from the selected row, so composer extensions mount once it exists | | `talk.catalog` | only the agent named by the key | Gateway: answers the caller's own unstarted main conversation from its agent (same `isStartableMainSession` rule as subscriptions); other missing or hidden keys still get "No session found" | Holding `talk.catalog` in the UI instead would keep dictation unavailable for the first message, and the protocol has no agent-only form of the request. Same PR, first send (two causes, both at their owner): - **Diff baseline (session creation owner).** The first turn captures the session diff baseline (`sessionDiffBaseline`, the files that existed before the session) about half a second after `chat.send` creates the row. A diff read in that window either showed pre-existing workspace files as session changes or was refused with "Session workspace changed during file access" when the baseline landed. A new operator conversation now records the pending baseline claim (`sessionDiffBaselineCapture`) with its row, as `sessions.create` already does (`buildNewSessionCreationFields` in `src/config/sessions/session-diff-baseline-capture.ts`), and the diff answers "no changes" while the claim is pending (`src/gateway/server-methods/sessions-diff.ts`). The first turn's existing capture settles the claim. - **Skill-library selection (workspace owner).** The first turn writes an empty selection (`librarySelections: []`) into a row that had none, and the session file workspace compared `undefined` with `[]` strictly. The sandbox owner already treats both as "no selection" (`librarySelections?.length`); the workspace check now does too. The existing access-change refusals (replaced row, revoked sharing) are unchanged. ## Impact - A new chat opens without an error. Processes and MCP controls appear after the first turn, which is when they can have content. The first message can be dictated. - No protocol or schema change.  ## Evidence - Real-Gateway Control UI e2e `ui/src/e2e/chat-new-session-readers.real-gateway.e2e.test.ts`: opens `agent:main:main` before its first turn at 1600x900, sends the first message, checks that no non-retryable Gateway read failed and that process, MCP and diff reads succeed after the row exists. Red on the merge base (the three refusals above), green on this branch. - `src/gateway/talk/handlers/catalog.test.ts` "answers the caller's unstarted main conversation from its agent": red on the merge base, green here. A missing non-main key and a caller who cannot start the conversation still get "No session found". - `src/gateway/server-methods/sessions-diff-reset.test.ts` "shows no changes for a new operator conversation before its first turn captures the baseline": creates the row through the real reply session init, then reads the diff of a repo with a pre-existing file. Red on the merge base (the pre-existing file is listed as a session change), green here. - `src/gateway/server-methods/session-file-live-read.test.ts` "keeps a diff read across the first turn recording no library skills": red on the merge base, green here; a real selection change still invalidates. - Isolated Gateway with a real provider, fresh agent main chat, Control UI at 1600x900: base shows the alert and logs the three refusals; this branch shows no alert and no refusal, and the first reply arrives. - Existing consumers: `chat-pane-side-panels.test.ts`, `chat-details-reload.e2e.test.ts`, `test/vitest-ui-e2e-config.test.ts` green. `chat-pane-state-snapshot.e2e.test.ts` was red on `main` and is fixed separately in #203246. - `pnpm tsgo:ui`, `pnpm check:test-types`, `pnpm check:changed` (the dead-export scan reports two exports in files this PR does not touch; same on `main`). Isolated Gateway first-send log (fresh agent, real provider, head rebased on #203283): from opening the brand-new chat through the first reply, no FORBIDDEN, UNAVAILABLE or INVALID_REQUEST line. The `talk.catalog` first-read "warming" answer is fixed at its owner in #203283. ## Merge danger Two-way door: a revert fully restores the previous behavior. No stored state, config or published contract changes. Blast radius: Control UI chats, `talk.catalog` callers for an unstarted main conversation, new operator session rows (pending diff-baseline claim), and session file/diff reads across the first turn. Co-authored-by: Ayaan Zaidi <[email protected]>
…w#203126) ## Problem Open a brand-new main chat (no messages yet, for example right after onboarding sets a model). Session Details shows a red "Session process access changed; refresh the conversation." with Retry until the first reply arrives. The Gateway log shows three refused reads for the same chat: - `sessions.processes.list` → `FORBIDDEN` "Session process access changed; refresh the conversation." - `mcp.app.discover` → `FORBIDDEN` "The requested session is unavailable; open an existing session first." - `talk.catalog` → `INVALID_REQUEST` "No session found: agent:main:main" A config hot reload is not needed: a fresh profile with a model already configured shows the same three refusals.  ## Root cause The agent's main conversation has no session row until its first turn creates it. The chat still starts session-scoped reads for it on open: - Session Details reads processes as soon as it renders (`ui/src/pages/chat/chat-pane-layout-render.ts:293`, process Details since openclaw#175041). The Gateway has no row to bind the list to and answers with the access-changed error (`src/gateway/server-methods/session-processes.ts:69-79`, since openclaw#164061). - The composer mounts MCP discovery for the chat. The composer already has a `sessionAdmitted` gate for provisional sessions (`chat-composer-view.tsx:414`, openclaw#166865), but the chat pane never set it. Discovery needs a session authority, which needs a row (`src/gateway/session-access-authority.ts:246`). - The composer reads the session-scoped Talk catalog. The catalog only uses the key to pick the agent, but `talk.catalog` refused the missing row (`src/gateway/talk/handlers/catalog.ts:536`). Subscriptions already admit the caller's own unstarted main conversation (`isStartableMainSession`, openclaw#197151). v2026.11.6 has the same chat pane and process code. ## Fix Each reader is fixed at the owner of the fact it depends on: | Read | Depends on | Owner and fix | |---|---|---| | `sessions.processes.list` | the row's `sessionId` | Control UI: Details stops offering process reads once the chat's history read proved the session absent (`isChatSessionProvenAbsent`, openclaw#197151). A cold load of an existing chat keeps its Details layout while rows load. | | `mcp.app.discover` | a session authority built from the row | Control UI: the chat pane sets the composer's existing `sessionAdmitted` gate from the selected row, so composer extensions mount once it exists | | `talk.catalog` | only the agent named by the key | Gateway: answers the caller's own unstarted main conversation from its agent (same `isStartableMainSession` rule as subscriptions); other missing or hidden keys still get "No session found" | Holding `talk.catalog` in the UI instead would keep dictation unavailable for the first message, and the protocol has no agent-only form of the request. Same PR, first send (two causes, both at their owner): - **Diff baseline (session creation owner).** The first turn captures the session diff baseline (`sessionDiffBaseline`, the files that existed before the session) about half a second after `chat.send` creates the row. A diff read in that window either showed pre-existing workspace files as session changes or was refused with "Session workspace changed during file access" when the baseline landed. A new operator conversation now records the pending baseline claim (`sessionDiffBaselineCapture`) with its row, as `sessions.create` already does (`buildNewSessionCreationFields` in `src/config/sessions/session-diff-baseline-capture.ts`), and the diff answers "no changes" while the claim is pending (`src/gateway/server-methods/sessions-diff.ts`). The first turn's existing capture settles the claim. - **Skill-library selection (workspace owner).** The first turn writes an empty selection (`librarySelections: []`) into a row that had none, and the session file workspace compared `undefined` with `[]` strictly. The sandbox owner already treats both as "no selection" (`librarySelections?.length`); the workspace check now does too. The existing access-change refusals (replaced row, revoked sharing) are unchanged. ## Impact - A new chat opens without an error. Processes and MCP controls appear after the first turn, which is when they can have content. The first message can be dictated. - No protocol or schema change.  ## Evidence - Real-Gateway Control UI e2e `ui/src/e2e/chat-new-session-readers.real-gateway.e2e.test.ts`: opens `agent:main:main` before its first turn at 1600x900, sends the first message, checks that no non-retryable Gateway read failed and that process, MCP and diff reads succeed after the row exists. Red on the merge base (the three refusals above), green on this branch. - `src/gateway/talk/handlers/catalog.test.ts` "answers the caller's unstarted main conversation from its agent": red on the merge base, green here. A missing non-main key and a caller who cannot start the conversation still get "No session found". - `src/gateway/server-methods/sessions-diff-reset.test.ts` "shows no changes for a new operator conversation before its first turn captures the baseline": creates the row through the real reply session init, then reads the diff of a repo with a pre-existing file. Red on the merge base (the pre-existing file is listed as a session change), green here. - `src/gateway/server-methods/session-file-live-read.test.ts` "keeps a diff read across the first turn recording no library skills": red on the merge base, green here; a real selection change still invalidates. - Isolated Gateway with a real provider, fresh agent main chat, Control UI at 1600x900: base shows the alert and logs the three refusals; this branch shows no alert and no refusal, and the first reply arrives. - Existing consumers: `chat-pane-side-panels.test.ts`, `chat-details-reload.e2e.test.ts`, `test/vitest-ui-e2e-config.test.ts` green. `chat-pane-state-snapshot.e2e.test.ts` was red on `main` and is fixed separately in openclaw#203246. - `pnpm tsgo:ui`, `pnpm check:test-types`, `pnpm check:changed` (the dead-export scan reports two exports in files this PR does not touch; same on `main`). Isolated Gateway first-send log (fresh agent, real provider, head rebased on openclaw#203283): from opening the brand-new chat through the first reply, no FORBIDDEN, UNAVAILABLE or INVALID_REQUEST line. The `talk.catalog` first-read "warming" answer is fixed at its owner in openclaw#203283. ## Merge danger Two-way door: a revert fully restores the previous behavior. No stored state, config or published contract changes. Blast radius: Control UI chats, `talk.catalog` callers for an unstarted main conversation, new operator session rows (pending diff-baseline claim), and session file/diff reads across the first turn. Co-authored-by: Ayaan Zaidi <[email protected]>
What Problem This Solves
Fixes the header and composer disappearing after the first prompt is sent while a new session is still being created.
User Impact
The header, submitted prompt, and composer stay in their final positions through session confirmation. Navigation remains usable while sending stays disabled until the session is ready. Incognito and failed-create draft recovery are preserved.
Why This Change Was Made
The admission preview now reuses the chat layout and chrome without mounting session controllers or MCP extensions before admission. Provisional clicks cannot change a saved split layout or inherit its unbound-pane state.
Evidence
node scripts/run-vitest.mjs run --config test/vitest/vitest.ui-e2e.config.ts --configLoader runner ui/src/e2e/new-session-page.transition.e2e.test.ts ui/src/e2e/new-session-page.cloud-startup-failure.e2e.test.ts ui/src/e2e/new-session-page.instant-thread.e2e.test.ts ui/src/e2e/new-session-page.saved-split.e2e.test.ts --maxWorkers=1.scripts/publish-model-catalog.mts: readRecommendedModelsandsrc/config/sessions/session-cold-storage-guard.types.ts: SessionColdTurnGuard. Scoped checks completed separately. No live Safari/device claim; the mobile captures use Chromium.Before
After
Requested by @steipete.
Work sessions