Skip to content

fix(ui): keep header and composer visible during session startup - #166865

Merged
roboclaw-bot merged 2 commits into
mainfrom
openclaw/fix-missing-composer-and-header-transition
Oct 8, 2026
Merged

roboclaw-bot merged 2 commits into
mainfrom
openclaw/fix-missing-composer-and-header-transition

Conversation

@roboclaw-bot

@roboclaw-bot roboclaw-bot commented Oct 8, 2026 •

Copy link
Copy Markdown
Collaborator

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

  • Built-UI Playwright regression proof: 46/46 passed, covering mobile and desktop geometry, navigation, incognito, canonical replacement, reconnect, rejection, attachment recovery, and saved/unbound splits.
  • Command: 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.
  • Combined wall time: 82.88 s, including the UI build. Measured file costs: instant-thread ~20 s; transition matrix ~32 s; cloud failure ~13 s; saved splits ~4 s. These suites exercise real routing, delayed admission, viewport/theme/motion states and recovery, which cannot be proven through a renderer-only unit test.
  • The initial hosted run exposed stale transition selectors. Both ClawSweeper findings are addressed in the test correction: the live announcement follows the new conversation wrapper; obsolete draft inset and missing-input assertions now require visible header and disabled mutation controls. All announcement, prompt custody, retry, and recovery assertions remain covered.
  • Production is +113 lines to reuse existing chrome before admission; the standalone pending-page renderer is removed. No new state owner, public API, or persistence changes.
  • UI/core-test typechecks, targeted lint/stylelint, formatting, and diff checks passed.
  • Independent source review and pre-publication AutoReview: no remaining actionable P0–P2 findings.
  • Full changed-check stopped on two unrelated unused exports already present in the unchanged base: scripts/publish-model-catalog.mts: readRecommendedModels and src/config/sessions/session-cold-storage-guard.types.ts: SessionColdTurnGuard. Scoped checks completed separately. No live Safari/device claim; the mobile captures use Chromium.
  • Inspected before/after screenshots were delivered in the work session.

Before

Header and composer missing during startup

After

Stable header and composer during startup

Requested by @steipete.

Work sessions

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]>
@clawsweeper

clawsweeper Bot commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@roboclaw-bot
roboclaw-bot marked this pull request as ready for review October 8, 2026 01:27
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Oct 8, 2026
@clawsweeper

clawsweeper Bot commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed October 7, 2026, 9:53 PM ET / October 8, 2026, 01:53 UTC (Revision 2).

ClawSweeper review

What this changes

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

  • Before: The prompt and “Starting…” indicator appear while the header and composer disappear.
  • After: The header, submitted prompt, and disabled composer remain visible during session creation.

Review scores

Measure Result What it means
Overall readiness 🦞 diamond lobster (5/6) A focused, worthwhile repair with inspected visual proof, meaningful browser coverage, and both previous findings resolved.
Proof confidence 🦞 diamond lobster (5/6) ✨ media proof bonus Sufficient (screenshot): Inspected before/after Chromium captures show the actual Control UI startup preview retaining the shared header and disabled composer around the same synthetic prompt. The reported built-UI browser run covers delayed admission, confirmation, recovery, and saved splits; screenshots support the visual change directly. No stored-data format or migration changes are introduced.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: After sending the first prompt, users temporarily lose the conversation header and composer while the session starts.
Reason: This restores the established chat presentation during startup without adding configuration or a separate creation flow. The recorded request aligns with prior area-owner work.

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
Reviewed head: cca13aff83fbead68dedc1f2971155cbfc394e01

Before merge

None.

Findings

None.

Agent review details

How this fits together

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

Technical review

Best 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

Testing

Proof path: shipped entry point. Added test files: 4.

Security

None.

Evidence

What I checked:

  • Introduced production change: The pinned introduction delta replaces the standalone pending-page renderer with the existing chat layout and supplies a display-only composer with canSend:false and sessionAdmitted:false. (ui/src/pages/chat/pending-session-create.ts:174, cca13aff83fb)
  • Current main still needs the fix: Fetched main renders only the pending conversation section and lightbox, without the shared header or composer. Comparing all eleven touched paths from the merge base to fetched main returned no changes. (ui/src/pages/chat/pending-session-create.ts:83, b5c9a25685ff)
  • Inspected before and after proof: Downloaded proof-image-1.png shows the synthetic prompt and Starting indicator without chat chrome; proof-image-2.png shows the same prompt with the New session header, navigation controls, and disabled composer. The manifest maps these files to the PR's embedded GitHub attachments. This directly supports the visual claim in Chromium, without establishing Safari or native-device behavior.
  • Previous findings resolved: The latest commit updates the transition announcement selector for the conversation wrapper, replaces the obsolete scroll-inset expectation with visible-header and disabled-composer assertions, and repairs deleted-Incognito expectations while retaining recovery and no-send checks. The PR body reports all four affected browser suites passing, 46/46 in 82.88 seconds; this review did not execute tests. (ui/src/e2e/new-session-page.transition.e2e.test.ts:714, cca13aff83fb)
  • Admission and saved-layout boundaries: Browser coverage checks that provisional previews mount no real chat pane, issue no startup/send or session-scoped MCP discovery, retain the original URL, and preserve persisted split settings through clicks, rejection, and reload. Confirmation adopts only agent:main:confirmed-split-thread in the active saved pane. (ui/src/e2e/new-session-page.saved-split.e2e.test.ts:104, cca13aff83fb)
  • Existing ownership and intent: History connects the preview to fix(ui): open new threads instantly #114032 and prompt-custody recovery to fix(ui): keep submitted prompts visible across session startup #152241. Their stated intent is immediate read-only presentation with execution, recovery, credentials, and storage retained by existing owners. The current PR preserves those boundaries; its body records the requested direction from steipete, whose prior merged work covers this area. (ui/src/pages/chat/pending-session-create.ts:63, 5d39249118e2)

Likely related people:

  • Peter Steinberger: Raw commit 5d39249 adds ui/src/pages/chat/pending-session-create.ts:52 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 5d39249118e2; files: ui/src/pages/chat/pending-session-create.ts)
  • Vyctor H. Brzezowski: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

PR surface

Source +113, Tests +81. Total +194 across 11 files.

View PR surface stats
Area Files Added Removed Net
Source 7 180 67 +113
Tests 4 256 175 +81
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 11 436 242 +194

Review metrics

Metric Value Why it matters
Production versus test growth production net +113 lines; tests net +81 lines Production growth reuses existing chat chrome and removes the standalone pending-page rendering path; browser coverage protects geometry, admission, and persisted split settings.

Labels

Label changes:

  • add rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • remove rating: 🦐 gold shrimp: Current PR rating is rating: 🦞 diamond lobster, so this older rating label is no longer current.
  • remove status: ⏳ waiting on author: Current PR status label is status: 👀 ready for maintainer look.

Label justifications:

  • P2: The fix addresses a bounded, visible startup-layout disruption while preserving the working session-creation flow.
  • rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • proof: sufficient: Contributor real behavior proof is sufficient.
  • proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence.

Rating scale

6/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.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only; repair and merge need explicit maintainer commands such as @clawsweeper autofix or @clawsweeper automerge.

History

Review history (1 earlier review cycle)
  • reviewed 2026-10-08T01:33:49.740Z sha 99a4d44 :: needs changes before merge. :: [P2] Update the transition matrix for the shared preview layout | [P2] Assert disabled composer controls in deleted-startup coverage

Keep announcement, prompt custody, retry, and disabled-mutation checks across the shared pending layout.

Co-authored-by: steipete <[email protected]>
@clawsweeper clawsweeper Bot added rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Oct 8, 2026
@roboclaw-bot
roboclaw-bot merged commit da08dc8 into main Oct 8, 2026
94 checks passed
@roboclaw-bot
roboclaw-bot deleted the openclaw/fix-missing-composer-and-header-transition branch October 8, 2026 02:02
@roboclaw-bot

Copy link
Copy Markdown
Collaborator Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 8, 2026
…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]>
steipete added a commit that referenced this pull request Oct 8, 2026
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.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 9, 2026
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.
obviyus added a commit that referenced this pull request Nov 22, 2026
## 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.

![Before: new chat shows the process access alert](https://github.com/user-attachments/assets/da479b13-8826-428d-b009-f85f9c914719)

## 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.

![After: new chat opens without the alert](https://github.com/user-attachments/assets/fccbce31-4a42-4e73-a9b5-4f8d0adb2460)

## 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]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 22, 2026
…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.

![Before: new chat shows the process access alert](https://github.com/user-attachments/assets/da479b13-8826-428d-b009-f85f9c914719)

## 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.

![After: new chat opens without the alert](https://github.com/user-attachments/assets/fccbce31-4a42-4e73-a9b5-4f8d0adb2460)

## 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]>
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 P2 Normal backlog priority with limited blast radius. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. size: L 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