Skip to content

fix(control-ui): create sessions for typed /new#75988

Merged
BunsDev merged 2 commits intomainfrom
meow/control-ui-typed-new-session
May 2, 2026
Merged

fix(control-ui): create sessions for typed /new#75988
BunsDev merged 2 commits intomainfrom
meow/control-ui-typed-new-session

Conversation

@BunsDev
Copy link
Copy Markdown
Member

@BunsDev BunsDev commented May 2, 2026

Summary

Duplicate / related work

Validation

  • node scripts/run-vitest.mjs run --config test/vitest/vitest.unit-ui.config.ts ui/src/ui/app-chat.test.ts ui/src/ui/chat/slash-commands.browser-import.test.ts
  • node scripts/run-vitest.mjs run --config test/vitest/vitest.ui.config.ts ui/src/ui/app-render.helpers.node.test.ts
  • pnpm exec oxfmt --check --threads=1 ui/src/ui/app-chat.ts ui/src/ui/app-chat.test.ts ui/src/ui/app.ts docs/web/control-ui.md docs/tools/slash-commands.md CHANGELOG.md
  • git diff --check origin/main...HEAD
  • pnpm check:changelog-attributions
  • node scripts/check-no-conflict-markers.mjs
  • node scripts/check-changed.mjs --dry-run --base origin/main
  • Testbox: blacksmith testbox run --id tbx_01kqkwx6yyhtc64r8jagm2383w "env OPENCLAW_TESTBOX=1 pnpm check:changed" completed successfully during retry; the box was stopped and no active Testbox boxes remain. The backing Actions run was cancelled after the CLI returned because it stayed in progress with no active box.

Current CI note

  • The PR is mergeable and ready for review at abaa6f90db464e14a6e0091d91c65d891f459a26.
  • Exact-head GitHub CI is currently blocked by non-touched current-main failures: check-dependencies reports extensions/whatsapp/src/auto-reply/session-snapshot.ts as an unexpected unused file, and checks-node-core-runtime-infra reports generated config-schema baseline drift around gateway.remote.* fields.

Fixes #69599

Copy link
Copy Markdown
Member Author

BunsDev commented May 2, 2026

@clawsweeper review

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation app: web-ui App: web-ui size: S maintainer Maintainer-authored PR labels May 2, 2026
@clawsweeper
Copy link
Copy Markdown
Contributor

clawsweeper Bot commented May 2, 2026

🦞🦞
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.

@clawsweeper
Copy link
Copy Markdown
Contributor

clawsweeper Bot commented May 2, 2026

Codex review: needs maintainer review before merge.

Summary
The branch routes typed Control UI /new through the dashboard new-session action, leaves typed /reset on chat.send, and updates focused tests, docs, and changelog.

Reproducibility: yes. On current main, typing /new in Control UI reaches the local new slash-command case and sends chat.send with /new, while the New Chat button already uses createChatSession.

Next step before merge
Protected maintainer PR with no discrete automated repair; the next action is normal maintainer review and exact-head validation.

Security
Cleared: The patch is limited to Control UI dispatch, focused tests, docs, and changelog with no new dependency, workflow, secret, install, package, or release surface.

Review details

Best possible solution:

Land this focused alignment after maintainer review and exact-head validation, while keeping routing-mode drift and unrelated session-label reports separate.

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

Yes. On current main, typing /new in Control UI reaches the local new slash-command case and sends chat.send with /new, while the New Chat button already uses createChatSession.

Is this the best way to solve the issue?

Yes. Reusing the existing dashboard createChatSession path for typed /new is the narrowest maintainable fix, and preserving /reset as an explicit Gateway reset keeps the documented boundary clear.

Acceptance criteria:

  • node scripts/run-vitest.mjs run --config test/vitest/vitest.unit-ui.config.ts ui/src/ui/app-chat.test.ts ui/src/ui/chat/slash-commands.browser-import.test.ts
  • node scripts/run-vitest.mjs run --config test/vitest/vitest.ui.config.ts ui/src/ui/app-render.helpers.node.test.ts
  • pnpm exec oxfmt --check --threads=1 ui/src/ui/app-chat.ts ui/src/ui/app-chat.test.ts ui/src/ui/app.ts docs/web/control-ui.md docs/tools/slash-commands.md CHANGELOG.md
  • pnpm check:changelog-attributions
  • pnpm check:changed

What I checked:

  • Protected PR context: GitHub API and provided context show this PR is open, authored by a MEMBER, labeled maintainer, and currently headed at 20f189a, so this cleanup workflow should not close it. (20f189a41eb2)
  • Current-main typed /new behavior: On current main, the local slash-command new case still calls sendChatMessageNow(host, "/new", ...), which goes through the Gateway chat-send/reset route rather than dashboard session creation. (ui/src/ui/app-chat.ts:545, b8c0a1e9ff24)
  • Existing dashboard session path: Current main already has createChatSession, which calls createSessionAndRefresh, switches to the returned session key, and preserves composer draft/attachments around the switch. (ui/src/ui/app-render.helpers.ts:608, b8c0a1e9ff24)
  • Existing New Chat button wiring: The rendered Control UI New Chat action already calls createChatSession(state), matching the helper this PR routes typed /new through. (ui/src/ui/app-render.ts:2377, b8c0a1e9ff24)
  • PR patch behavior: The PR patch excludes new from queued local slash commands, changes the new case to await host.onSlashAction("new-session"), and wires that action to createChatSessionInternal in the app host. (ui/src/ui/app-chat.ts:529, abaa6f90db46)
  • Focused test coverage: The PR patch updates app-chat.test.ts to assert typed /new calls the fresh-session action without confirmation, does not queue behind an active run, and typed /reset still dispatches through chat.send. (ui/src/ui/app-chat.test.ts:469, abaa6f90db46)

Likely related people:

  • vincentkoc: Merged related WebChat New Chat dashboard session create/switch work in fix(webchat): create dashboard sessions from New Chat #73725, which this PR extends to typed /new. (role: adjacent feature owner; confidence: high; commits: 983c634ec05b, 2e50f167cefa, 1912e309f7bc; files: ui/src/ui/app-render.helpers.ts, ui/src/ui/app-render.ts, ui/src/ui/app-chat.ts)
  • steipete: Local blame shows the current split Control UI files and central typed slash-command path were introduced into the current checkout by the browser config facade refactor, and git history shows repeated adjacent WebChat/session maintenance. (role: recent maintainer; confidence: medium; commits: 68c99879e2bf, 19046e0cfcd6, 382785c6ced9; files: ui/src/ui/app-chat.ts, ui/src/ui/app-render.helpers.ts, ui/src/ui/app.ts)
  • BunsDev: Provided review context connects this maintainer to recent current-main Control UI session continuity, active-run refresh, and slash-command discovery work beyond authorship of this PR. (role: recent maintainer; confidence: medium; commits: cb9d7884cca3, c34ed90822a9, d0c83777fb58; files: ui/src/ui/app-render.helpers.ts, ui/src/ui/app.ts, ui/src/ui/app-chat.ts)

Codex review notes: model gpt-5.5, reasoning high; reviewed against b8c0a1e9ff24.

@BunsDev BunsDev force-pushed the meow/control-ui-typed-new-session branch from 5cbc268 to 30e039c Compare May 2, 2026 07:20
Copy link
Copy Markdown
Member Author

BunsDev commented May 2, 2026

@clawsweeper review

@clawsweeper
Copy link
Copy Markdown
Contributor

clawsweeper Bot commented May 2, 2026

🦞🦞
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.

@BunsDev BunsDev force-pushed the meow/control-ui-typed-new-session branch from 30e039c to 647662b Compare May 2, 2026 07:26
Copy link
Copy Markdown
Member Author

BunsDev commented May 2, 2026

@clawsweeper review

@clawsweeper
Copy link
Copy Markdown
Contributor

clawsweeper Bot commented May 2, 2026

🦞🦞
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.

@BunsDev BunsDev force-pushed the meow/control-ui-typed-new-session branch from 647662b to 08af5cf Compare May 2, 2026 07:33
Copy link
Copy Markdown
Member Author

BunsDev commented May 2, 2026

@clawsweeper review

@clawsweeper
Copy link
Copy Markdown
Contributor

clawsweeper Bot commented May 2, 2026

🦞🦞
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.

Copy link
Copy Markdown
Member Author

BunsDev commented May 2, 2026

@clawsweeper review

@clawsweeper
Copy link
Copy Markdown
Contributor

clawsweeper Bot commented May 2, 2026

🦞🦞
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.

@BunsDev BunsDev force-pushed the meow/control-ui-typed-new-session branch from 958f3c3 to f3583bd Compare May 2, 2026 07:39
Copy link
Copy Markdown
Member Author

BunsDev commented May 2, 2026

@clawsweeper review

@clawsweeper
Copy link
Copy Markdown
Contributor

clawsweeper Bot commented May 2, 2026

🦞🦞
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.

@BunsDev BunsDev force-pushed the meow/control-ui-typed-new-session branch from f3583bd to 18e6ce2 Compare May 2, 2026 07:41
Copy link
Copy Markdown
Member Author

BunsDev commented May 2, 2026

@clawsweeper review

@clawsweeper
Copy link
Copy Markdown
Contributor

clawsweeper Bot commented May 2, 2026

🦞🦞
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.

@BunsDev BunsDev force-pushed the meow/control-ui-typed-new-session branch 2 times, most recently from 86f95fe to a94c241 Compare May 2, 2026 07:52
@BunsDev
Copy link
Copy Markdown
Member Author

BunsDev commented May 2, 2026

@clawsweeper review

@clawsweeper
Copy link
Copy Markdown
Contributor

clawsweeper Bot commented May 2, 2026

🦞🦞
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.

@BunsDev BunsDev force-pushed the meow/control-ui-typed-new-session branch 2 times, most recently from 9115044 to 2b495a1 Compare May 2, 2026 08:25
@BunsDev BunsDev force-pushed the meow/control-ui-typed-new-session branch from 2b495a1 to abaa6f9 Compare May 2, 2026 08:29
@BunsDev
Copy link
Copy Markdown
Member Author

BunsDev commented May 2, 2026

@clawsweeper review

@clawsweeper
Copy link
Copy Markdown
Contributor

clawsweeper Bot commented May 2, 2026

🦞🦞
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.

@BunsDev BunsDev merged commit 37aebf6 into main May 2, 2026
78 checks passed
@BunsDev BunsDev deleted the meow/control-ui-typed-new-session branch May 2, 2026 09:02
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 maintainer Maintainer-authored PR size: S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Control UI /new, /reset, and New Session do not create the same true fresh session as direct session creation

1 participant