Skip to content

fix(ui): select new sessions immediately while naming - #172863

Merged
roboclaw-bot merged 7 commits into
mainfrom
openclaw/sharp-shell
Oct 15, 2026
Merged

roboclaw-bot merged 7 commits into
mainfrom
openclaw/sharp-shell

Conversation

@roboclaw-bot

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

Copy link
Copy Markdown
Collaborator

What Problem This Solves

Fixes: the previous conversation stays selected while a new session starts, and “New session” looks like a finished title while automatic naming is still running.

User Impact

New sessions immediately appear selected in the sidebar. A subtle animated placeholder appears in the sidebar and chat header until naming succeeds or fails, respects reduced motion, and restores the draft if creation is rejected. No configuration or migration is required.

Why This Change Was Made

Keep provisional selection in the existing create handoff instead of admitting an uncreated session to Gateway state. Derive naming status from the existing title-request registry and publish both start and settlement, including failed naming. Suppress duplicate rows during admission without changing authoritative session membership.

Evidence

  • After conflict integration: 24 mocked-Gateway browser scenarios passed, including the formerly failing transition/rejected-edit flow. The final lineage-owner adjustment also passed all three pending-sidebar browser scenarios.
  • 58 focused UI tests passed; after the final lineage adjustment, 30 sidebar projection/lineage tests passed. Initial implementation proof also covered 64 Gateway tests for title-request eviction/notification ordering, false-clearing events, and late worktree completion.
  • Current-head CI run 38796805372 passed for 56952494dd71d4a67422a0e8b5e11d56d266e9a1; required CI/security gates are green. Canonical UI typecheck, scoped lint, formatting, and mock-factory ratchet also passed locally.
  • The preceding run exposed an unrelated Apple-cache fixture type error inherited from main. Reproduced it on main, fixed its actual workflow context type in 68fed4aa461, and integrated that repair without conflicts. Root scripts and UI typechecks plus 15 title projection/state/event tests passed after integration.
  • New test cost: pending-sidebar browser file 3.1s test time / 32.8s final wall time including bundle build; focused route tests run in the existing unit suite. CI timing will be recorded by the current-head run.
  • Simplification: reuse the existing creation and title-request owners; no persisted state or second registry. Route handoff renewal remains connection-validated, and provisional lineage admission now lives at the lineage entry point rather than a sidebar lifecycle wrapper.
  • Inspected before/after screenshots below use a mocked-Gateway Control UI scenario, not a live production Gateway.

Before

Before: previous session remains selected while a new session starts

After

After: the provisional session is selected with animated title placeholders

Worked on by

Work sessions


View the OpenClaw team session

Worked on by:
- @steipete

Co-authored-by: steipete <[email protected]>
OpenClaw-Publication: 51730352-a3b2-4b6b-a3d4-131040698246
@clawsweeper

clawsweeper Bot commented Oct 15, 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.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation app: web-ui App: web-ui gateway Gateway runtime agents Agent runtime and tooling size: L labels Oct 15, 2026
@roboclaw-bot
roboclaw-bot marked this pull request as ready for review October 15, 2026 06:48
roboclaw-bot and others added 2 commits October 15, 2026 07:04
Integrates the existing composer directive contract fix required by check-lint-core-2.

Co-authored-by: steipete <[email protected]>
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. 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 15, 2026
@clawsweeper

clawsweeper Bot commented Oct 15, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs changes before merge.

What this changes

This PR immediately selects a provisional session and shows placeholders while automatic naming is pending.

Example: Start a session with “Review release readiness and outstanding fixes” while “Weekly planning” is selected.

  • Before: Weekly planning remains highlighted while the new conversation starts.
  • After: A provisional row becomes selected immediately, with naming placeholders in the sidebar and header.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) Useful, coherent ownership-preserving repair with inspected browser evidence, limited Gateway runtime evidence, and one concrete CI blocker.
Proof confidence 🦐 gold shrimp (3/6) This collaborator-authored PR is outside the ordinary contributor proof gate; inspected mocked-Gateway screenshots establish provisional selection and placeholder appearance, while Gateway naming publication is supported by focused tests.
Patch quality 🦐 gold shrimp (3/6) 1 actionable review finding remain.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: The sidebar points at the previous conversation while a new one starts, and an unfinished name looks final.
Reason: The maintainer-authored direction resolves visible confusion without adding configuration or competing session authority.

Merge readiness

⛔ Needs changes before merge - 1 item remains

Keep this useful maintainer-authored PR open; one changed test mock causes a required ratchet failure.

Priority: P2
Reviewed head: 805f39628472f40d6cd2f2e0cc8d28f7fad112a3

Before merge

  • Explain the changed mock's isolation and prune its old baseline entry (P2) - Renaming this closed factory's export changes its fingerprint, so its grandfathered entry in config/test-mock-exports-baseline.txt no longer covers it. scripts/check-test-mock-exports.mts rejects the new unannotated factory, matching the exact-head mock-exports failure. Add an adjacent mock-isolation explanation for suppressing real event publication, then prune the obsolete baseline entry rather than adding an allowance.

Findings

  • [P2] Explain the changed mock's isolation and prune its old baseline entry — src/gateway/server-methods/session-discussion.test.ts:55-57

Tests

  • Missing end-to-end proof: No real-Gateway capture demonstrates naming start and successful or failed settlement, and baseline failure of the new browser regression is not shown.
Agent review details

How this fits together

The Control UI creation handoff supplies provisional presentation, while the Gateway naming registry supplies runtime status through session rows and change events.

flowchart LR
  A[New session composer] --> B[Creation handoff]
  B --> C[Provisional sidebar row]
  B --> D[Gateway session creation]
  D --> E[Existing naming registry]
  E --> F[Session rows and events]
  F --> G[Sidebar and chat header]
Loading

Technical review

Best possible solution:

Retain the existing handoff and naming owners, and repair the changed isolated mock without expanding the baseline.

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

Current-main source retains the admitted selection during provisional creation, matching the inspected before screenshot; no target code was executed during this review.

Is this the best way to solve the issue?

The approach fits the existing ownership boundaries: provisional presentation stays outside authoritative membership, and naming status derives from the existing generation-scoped registry.

Full review comments:

  • [P2] Explain the changed mock's isolation and prune its old baseline entry — src/gateway/server-methods/session-discussion.test.ts:55-57
    Renaming this closed factory's export changes its fingerprint, so its grandfathered entry in config/test-mock-exports-baseline.txt no longer covers it. scripts/check-test-mock-exports.mts rejects the new unannotated factory, matching the exact-head mock-exports failure. Add an adjacent mock-isolation explanation for suppressing real event publication, then prune the obsolete baseline entry rather than adding an allowance.
    Confidence: 0.99

Overall correctness: patch is incorrect
Overall confidence: 0.9

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 148a19f69f2c.

Provenance checked

  • Provisional creation and saved selection keeps the original intent (88d5171: Show the submitted conversation immediately while preserving admission, draft custody, and saved selection until acceptance.)
  • Shared title request ownership keeps the original intent (f8b8956: Consolidate joins, retries, settlement, and late completion under one naming owner.)
  • Detached title generation keeps the original intent (eacaa1b: Keep background naming from holding turn admission and blocking session mutations.)
  • Sidebar projection memoization keeps the original intent (6f24d83: Reuse row projections with explicit invalidation for every live input.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

Acceptance criteria:

  • pnpm check:test-mock-exports --base ed535c5
  • pnpm test src/gateway/server-methods/session-discussion.test.ts --maxWorkers=1
  • git diff --check

What I checked:

  • Pinned introduction: Reviewed the introduced merge-base-to-head hunks; current main retains the previous selection and title-notification paths. (ui/src/components/app-sidebar-base.ts:286, 805f39628472)
  • Diff-caused mock ratchet failure: CI reports mock-exports failure. The changed closed factory has a different fingerprint from its exact baseline entry and lacks the adjacent isolation annotation required by the checker. (src/gateway/server-methods/session-discussion.test.ts:55, 805f39628472)
  • Runtime-only naming status: titlePending is sampled from the existing registry for the exact store, key, and session generation; it is added to presented rows rather than persisted session entries. (src/gateway/session-row-projection-record.ts:480, 805f39628472)
  • Inspected visual evidence: Both downloaded screenshots were inspected. They show the previous highlight being replaced by a selected provisional row and header placeholder; the PR explicitly identifies a mocked-Gateway browser scenario. (ui/src/e2e/new-session-pending-sidebar.e2e.test.ts:61, 805f39628472)
  • CI attribution limitation: Lint annotations concern untouched files, the typecheck annotation supplies no diagnostic, and the browser failure is a route-settlement timeout. Their causes remain unclassified: detailed job-log retrieval redirected to a blocked Azure host, so these failures are not assigned to the contributor. (805f39628472)
  • Repository policy and clean checkout: Read the root and applicable UI, Gateway, server-methods, agents, and docs instructions. The maintainer-notes directory is absent, and the checkout remains clean. (AGENTS.md:1, 805f39628472)

Likely related people:

  • RoboClaw: Raw commit ac93c14 adds ui/src/pages/new-session/instant-thread-handoff.ts:27 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: medium; commits: ac93c14ffd6f; files: ui/src/pages/new-session/instant-thread-handoff.ts)
  • Mert Başar: Raw commit 9ed025c adds src/gateway/dashboard-session-title.ts:237 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: medium; commits: 9ed025c44dde; files: src/gateway/dashboard-session-title.ts)

PR surface

Source +175, Tests +364, Docs +7. Total +546 across 37 files. Added test files: 3.

View PR surface stats
Area Files Added Removed Net
Source 26 239 64 +175
Tests 10 385 21 +364
Docs 1 7 0 +7
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 37 631 85 +546

Labels

Label changes:

  • add P2: The PR addresses limited Control UI selection and naming confusion; the identified repair is a focused test-check failure.
  • add proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🦐 gold shrimp.
  • add status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.

Label justifications:

  • P2: The PR addresses limited Control UI selection and naming confusion; the identified repair is a focused test-check failure.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🦐 gold shrimp.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.
  • 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 execution lanes are retired.

Reviewed October 15, 2026, 3:08 AM ET / 07:08 UTC.

roboclaw-bot and others added 3 commits October 15, 2026 19:26
Keep the connection-validated handoff through both navigation-key and draft/focus hint cleanup. Reject it after reconnect.

Co-authored-by: steipete <[email protected]>
Preserve the current hidden-roster guard and move provisional-session lineage suppression into the new session data owner.

Co-authored-by: steipete <[email protected]>
Reject only the displayed unadmitted key at the lineage load boundary; leave the shared data controller unchanged.

Co-authored-by: steipete <[email protected]>
@roboclaw-bot
roboclaw-bot enabled auto-merge (squash) October 15, 2026 19:36
@roboclaw-bot
roboclaw-bot disabled auto-merge October 15, 2026 19:45
Integrate verified Apple cache context fix 68fed4a. No conflicts; title projection regressions and UI/scripts typechecks pass on the integrated tree.

Co-authored-by: steipete <[email protected]>
@roboclaw-bot
roboclaw-bot merged commit e8633bd into main Oct 15, 2026
150 checks passed
@roboclaw-bot
roboclaw-bot deleted the openclaw/sharp-shell branch October 15, 2026 20:10
@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 16, 2026
* fix(ui): select new sessions immediately while naming

Worked on by:
- @steipete

Co-authored-by: steipete <[email protected]>
OpenClaw-Publication: 51730352-a3b2-4b6b-a3d4-131040698246

* test: correct pending-title fixtures and mock isolation

Co-authored-by: steipete <[email protected]>

* fix: preserve new session route through focus cleanup

Keep the connection-validated handoff through both navigation-key and draft/focus hint cleanup. Reject it after reconnect.

Co-authored-by: steipete <[email protected]>

* refactor: keep provisional lineage guard in its owner

Reject only the displayed unadmitted key at the lineage load boundary; leave the shared data controller unchanged.

Co-authored-by: steipete <[email protected]>

---------

Co-authored-by: steipete <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling app: web-ui App: web-ui docs Improvements or additions to documentation gateway Gateway runtime P2 Normal backlog priority with limited blast radius. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: L status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant