Skip to content

feat(ui): start named sessions with /new --name - #93587

Closed
zhangguiping-xydt wants to merge 3 commits into
openclaw:mainfrom
zhangguiping-xydt:fix/issue-93422
Closed

zhangguiping-xydt wants to merge 3 commits into
openclaw:mainfrom
zhangguiping-xydt:fix/issue-93422

Conversation

@zhangguiping-xydt

@zhangguiping-xydt zhangguiping-xydt commented Jun 16, 2026 •

Copy link
Copy Markdown
Contributor

Closes #93422

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

Control UI users can create a fresh dashboard session with typed /new, but
there is no unambiguous way to give that new session a recognizable name. An
implicit /new <text> naming rule would also conflict with the model-oriented
meaning that /new arguments have on other chat surfaces.

A successful create could additionally finish persisting and listing the new
session without switching the active Control UI route when the list refresh
replaced the initiating chat pane.

Why This Change Was Made

Control UI now recognizes only the explicit /new --name <title> form for
new-session naming. Bare /new and every other /new <text> form retain the
existing anonymous dashboard-session behavior, while /name <title> remains
the shared rename command and other surfaces keep their existing /new
semantics.

This is a root-cause repair at the typed-command parsing and pane-lifecycle
ownership boundaries. The name continues through the existing validated
sessions.create.label path. The returned session key is handed to the
originating pane before the forced session-list refresh publishes, so
refresh-driven lifecycle changes cannot discard a successful route switch.
This adds no Gateway field, schema, permission, persistence, model-routing, or
non-Control-UI behavior.

User Impact

Control UI users can type /new --name Research Plan or
/new --name "Research Plan" to create, select, and visibly label a fresh
dashboard session. Existing /new usage remains compatible and anonymous
unless the explicit --name option is present.

If creation cannot safely switch the route, the typed command is restored in
the composer instead of disappearing as if it succeeded.

Evidence

  • Exact-head browser proof used commit
    25083b59e15a264352a5743e55a8ef235f5d7a57, a production Control UI build,
    and a real isolated Gateway. It exercised the malformed, explicit-name,
    bare, and arbitrary-text forms and inspected the session registry, returned
    metadata, URL, ChatPane state, selected session state, and active sidebar
    row.

    gatewayReady=true productionUiBuild=true
    malformed=/new --name sessions=1->1 usageVisible=true composerRestored=true
    command=/new --name "Strong E2E Proof"
    namedCreatedExactlyOne=true label="Strong E2E Proof" displayName="Strong E2E Proof"
    returnedKey==urlSession==paneKey==stateSession==activeSidebarKey=true
    bareNew: createdExactlyOne=true label=null active="New session"
    /new Legacy Text: createdExactlyOne=true label=null active="New session"
    allRuntimeAssertions=true
    
  • A fresh targeted recheck of the asynchronous draft concern used the same
    exact head and a new isolated Gateway/browser session:

    command=/new --name
    sessions=0->0
    usageVisible=true
    composerValue=/new --name
    browserErrors=[]
    

    The cited callback at chat-view.ts:267 belongs to the empty-thread welcome
    suggestions. The bottom composer is a separate branch and receives
    props.onSend directly at chat-view.ts:312; its settlement handler performs
    the final controlled-textarea synchronization. Temporarily discarding the
    Promise at that actual composer boundary makes the regression fail with an
    empty textarea, while the submitted exact head passes. No additional source
    change was made for the unrelated thread callback.

  • Affected UI tests: 410 passed across chat-send.test.ts,
    chat-view.test.ts, chat-pane.test.ts, and lib/sessions/index.test.ts.

    Test Files  1 passed (1)
    Tests       172 passed (172)
    
    Test Files  3 passed (3)
    Tests       238 passed (238)
    
  • pnpm check:changed -- ui/src/pages/chat/chat-view.ts ui/src/pages/chat/chat-view.test.ts
    passed, including formatting, type checking, lint, and changed-surface
    guards. Focused formatting, git diff --check, and a fresh production
    Control UI build also passed.

  • The compatibility boundary remains intentionally narrow: only explicit
    --name opts into naming, arbitrary text remains anonymous, and accepting
    this Control UI-specific option remains a maintainer product decision.

@openclaw-barnacle openclaw-barnacle Bot added app: web-ui App: web-ui gateway Gateway runtime commands Command implementations size: L proof: supplied External PR includes structured after-fix real behavior proof. labels Jun 16, 2026
@clawsweeper

clawsweeper Bot commented Jun 16, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed July 12, 2026, 8:23 PM ET / July 13, 2026, 00:23 UTC.

Summary
The PR adds explicit Control UI /new --name <title> parsing, creates a labeled dashboard session through the existing label contract, adopts its route before list refresh, and restores asynchronously failed composer drafts.

PR surface: Source +70, Tests +202, Docs +3. Total +275 across 10 files.

Reproducibility: not applicable. This PR adds a new command form rather than repairing a defined current-main failure; the proposed behavior nevertheless has high-confidence exact-head live proof.

Review metrics: 1 noteworthy metric.

  • Public command forms: 1 added, 0 removed. The patch adds one documented Control UI command form while deliberately preserving every existing /new form.

Stored data model
Persistent data-model change detected: serialized state: ui/src/lib/sessions/index.ts, unknown-data-model-change: ui/src/lib/sessions/index.ts. Confirm migration or upgrade compatibility proof before merge.

Root-cause cluster
Relationship: fixed_by_candidate
Canonical: #93422
Summary: This PR is the focused candidate for the linked Control UI naming request; the broader open session-command PR overlaps but is not a proof-positive or scope-equivalent superseder.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Merge readiness
Overall: 🐚 platinum hermit
Proof: 🦞 diamond lobster
Patch quality: 🐚 platinum hermit
Result: ready for maintainer review.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • A maintainer can sponsor and reopen the Control UI-specific /new --name <title> command contract.

Risk before merge

  • [P1] If accepted later, this becomes a documented Control UI-specific interpretation of /new arguments while shared channel surfaces retain model and reset semantics, so maintainers must intentionally own that compatibility boundary.

Maintainer options:

  1. Close until sponsored (recommended)
    Close the technically complete PR without adopting the new public command grammar, and reopen it if a maintainer confirms the direction.
  2. Accept the explicit grammar
    Intentionally own the Control UI-only /new --name <title> contract and retain the supplied compatibility and live-behavior proof.

Next step before merge

  • [P2] This is a product-direction cleanup close, not a code-repair candidate.

Maintainer decision needed

  • Question: Should Control UI adopt /new --name <title> as a supported named-session creation grammar while all other /new <text> forms and non-Control-UI surfaces keep their existing semantics?
  • Rationale: Code review can establish correctness, but only maintainers can accept a new public command contract and its deliberate cross-surface asymmetry.
  • Likely owner: steipete — The choice changes a documented user-facing Control UI command, and repository context plus the contributor's explicit review request point here as the best available decision owner.
  • Options:
    • Close pending sponsorship (recommended): Keep the existing /new then /name workflow and reopen this technically ready branch if a maintainer sponsors the new grammar.
    • Accept the narrow option: Sponsor /new --name <title> for Control UI only and preserve every existing bare, arbitrary-text, and non-Control-UI /new behavior.
    • Design shared semantics: Pause this branch and define one named-session creation grammar in the shared command layer before adding a Control UI shortcut.

Security
Cleared: The diff adds no dependency, workflow, permission, secret, package-resolution, download, or third-party execution surface.

Review details

Best possible solution:

Keep bare /new plus the existing /name <title> workflow as the supported default unless a maintainer sponsors the explicit Control UI option; if sponsored, reopen this focused branch and preserve its narrow grammar, existing label contract, and compatibility coverage.

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

Not applicable: this PR adds a new command form rather than repairing a defined current-main failure; the proposed behavior nevertheless has high-confidence exact-head live proof.

Is this the best way to solve the issue?

Yes technically: the explicit option avoids ambiguity with existing /new <text> semantics and reuses the canonical label and create paths, but adoption is not the best product outcome until maintainers confirm the public grammar.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 0ba1e5ca2eb6.

Label changes

Label changes:

  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): Exact-head live output from a production Control UI build and isolated Gateway demonstrates named and anonymous creation, malformed-command recovery, canonical route adoption, visible labels, and restored drafts after asynchronous failure.
  • remove rating: 🦐 gold shrimp: Current PR rating is rating: 🐚 platinum hermit, 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: This is a bounded, well-proven session-management improvement with limited blast radius and no urgent regression.
  • merge-risk: 🚨 compatibility: The Control UI-only /new argument meaning would become a documented public contract alongside different shared-channel semantics.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): Exact-head live output from a production Control UI build and isolated Gateway demonstrates named and anonymous creation, malformed-command recovery, canonical route adoption, visible labels, and restored drafts after asynchronous failure.
  • proof: sufficient: Contributor real behavior proof is sufficient. Exact-head live output from a production Control UI build and isolated Gateway demonstrates named and anonymous creation, malformed-command recovery, canonical route adoption, visible labels, and restored drafts after asynchronous failure.
Evidence reviewed

PR surface:

Source +70, Tests +202, Docs +3. Total +275 across 10 files.

View PR surface stats
Area Files Added Removed Net
Source 6 104 34 +70
Tests 3 205 3 +202
Docs 1 10 7 +3
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 10 319 44 +275

What I checked:

  • New public command surface: The branch recognizes only explicit /new --name <title>, preserves bare and arbitrary-text /new behavior, and rejects malformed explicit syntax without creating a session. (ui/src/pages/chat/chat-commands.ts:196, 25083b59e15a)
  • Existing session contract reused: The requested label flows through the existing sessions.create parameters rather than adding a Gateway field, schema, permission, or separate persisted naming surface. (ui/src/pages/chat/chat-pane.ts:1178, 25083b59e15a)
  • Lifecycle repair is bounded: The capability publishes the created session key to the initiating pane before the canonical list refresh, preventing refresh-driven pane replacement from losing a successful route switch. (ui/src/lib/sessions/index.ts:82, 25083b59e15a)
  • Previous finding is cleared: The actual composer retains the promise-returning send callback and synchronizes the controlled draft again after settlement; the promise-discarding wrapper discussed previously belongs to a separate welcome-suggestion path. (ui/src/pages/chat/components/chat-composer.ts:2317, 25083b59e15a)
  • Real behavior proof: The PR body supplies exact-head output from a production Control UI build and isolated Gateway covering named creation, preserved anonymous forms, malformed-command recovery, route/pane/state/sidebar identity, and draft restoration. (25083b59e15a)
  • Current supported alternative: Current main supports bare Control UI /new for fresh dashboard sessions and the shared /name <title> command for naming the active session, providing a supported two-step workflow. Public docs: docs/tools/slash-commands.md. (docs/tools/slash-commands.md:171, 0ba1e5ca2eb6)

Likely related people:

  • steipete: The contributor explicitly requested this account's review of the session and command UX direction, and the repository ownership context points here for the documented Control UI command decision. (role: likely product decision owner; confidence: medium; files: ui/src/pages/chat/chat-commands.ts, docs/tools/slash-commands.md)
  • vincentkoc: The contributor explicitly requested this account's session and command UX review, and recent adjacent work connects this account to session metadata behavior. (role: adjacent session behavior owner; confidence: medium; commits: 68ec783e74b5; files: src/auto-reply/reply/command-session-metadata.ts)
  • BSG2000: Authored the merged shared /name command that established chat-native session labels and identified named /new creation as follow-up scope. (role: introduced adjacent behavior; confidence: high; commits: b48238aa88b0; files: src/auto-reply/reply/commands-name.ts, docs/tools/slash-commands.md)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

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.

How this review workflow works
  • 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.
Review history (15 earlier review cycles; latest 8 shown)
  • reviewed 2026-07-07T14:51:56.660Z sha 6f5227f12c31ee592146908181e2a12ebab33adb :: needs maintainer review before merge. :: none
  • reviewed 2026-07-09T19:15:51.131Z sha f94b6d6bffbc0e5c28ba1c056f8ca168ddd39cd9 :: needs maintainer review before merge. :: none
  • reviewed 2026-07-09T19:23:08.738Z sha f94b6d6bffbc0e5c28ba1c056f8ca168ddd39cd9 :: needs maintainer review before merge. :: none
  • reviewed 2026-07-11T17:16:25.193Z sha 0bae6da43af23c453ad1fe99f61e6901556a6774 :: needs maintainer review before merge. :: none
  • reviewed 2026-07-11T17:24:30.429Z sha 0bae6da43af23c453ad1fe99f61e6901556a6774 :: needs maintainer review before merge. :: none
  • reviewed 2026-07-12T00:27:08.666Z sha 8cdb084c57f88e86b26bc2e040857bddd98e9490 :: needs real behavior proof before merge. :: none
  • reviewed 2026-07-12T09:41:50.207Z sha 0da0fe0aadadaed780b42a1846f94533297829bc :: needs maintainer review before merge. :: none
  • reviewed 2026-07-12T14:07:12.641Z sha 25083b5 :: needs changes before merge. :: [P1] Return the send promise to the composer

@openclaw-barnacle openclaw-barnacle Bot added channel: telegram Channel integration: telegram scripts Repository scripts and removed channel: telegram Channel integration: telegram labels Jun 16, 2026
@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P2 Normal backlog priority with limited blast radius. labels Jun 16, 2026
@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. 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. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Jun 19, 2026
@openclaw-barnacle openclaw-barnacle Bot added size: M and removed gateway Gateway runtime scripts Repository scripts commands Command implementations size: L proof: sufficient ClawSweeper judged the real behavior proof convincing. labels Jun 19, 2026
@clawsweeper clawsweeper Bot added the proof: sufficient ClawSweeper judged the real behavior proof convincing. label Jun 19, 2026
@clawsweeper clawsweeper Bot added 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. and removed status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Jun 20, 2026
@openclaw-barnacle openclaw-barnacle Bot added gateway Gateway runtime scripts Repository scripts commands Command implementations size: L and removed size: M labels Jul 5, 2026
@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. and removed 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 Jul 5, 2026
@openclaw-barnacle openclaw-barnacle Bot added size: M and removed scripts Repository scripts commands Command implementations size: L labels Jul 5, 2026
@zhangguiping-xydt

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Jul 5, 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 repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Jul 5, 2026
@zhangguiping-xydt

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Please re-review the current exact head 25083b59e15a264352a5743e55a8ef235f5d7a57 after the PR body proof update.

The reported ui/src/pages/chat/chat-view.ts:267 callback belongs to the thread/welcome consumer and only requires a void callback. The bottom composer path receives props.onSend directly and preserves its promise. Focused adapter mutation coverage and the exact-head browser/Gateway proof confirm that a failed /new --name command restores the composer draft.

Please refresh the contributor-facing finding and status label against the current head and updated proof.

@clawsweeper

clawsweeper Bot commented Jul 12, 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 repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

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 docs Improvements or additions to documentation merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. proof: supplied External PR includes structured after-fix real behavior proof. 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.

[Feature]: /label slash command & /new <name> session naming for WebChat/Control UI

1 participant