Skip to content

feat: add /new to clear chat#3527

Open
igennova wants to merge 2 commits into
PostHog:mainfrom
igennova:feat/slash-new-clear-chat
Open

feat: add /new to clear chat#3527
igennova wants to merge 2 commits into
PostHog:mainfrom
igennova:feat/slash-new-clear-chat

Conversation

@igennova

Copy link
Copy Markdown
Contributor

Problem

Users (especially in Command Center) want a slash command to clear the current chat and start fresh — the same muscle memory as /new / /clear in agent CLIs.

Part of #670

Changes

  • Add a built-in /new code command in the message editor autocomplete
  • Add SessionService.startFreshSession: tear down the current run and create a new task run so the transcript / logs start blank
  • Wire /new through useSessionCallbacks via an injected onNewSession callback (keeps commands free of session-service locators)
  • Local chats only; cloud shows a toast if /new isn’t available

Screenshot

Screenshot 2026-07-17 at 3 09 48 AM

How did you test this?

  • Unit tests: commands.test.ts, getSuggestions.test.ts, sessionServiceRetryConfig.test.ts (startFreshSession + resetSession unchanged)
  • Manual: type /new in a local session and confirm the chat clears to a blank transcript

@trunk-io

trunk-io Bot commented Jul 16, 2026

Copy link
Copy Markdown

Merging to main in this repository is managed by Trunk.

  • To merge this pull request, check the box to the left or comment /trunk merge below.

After your PR is submitted to the merge queue, this comment will be automatically updated with its status. If the PR fails, failure details will also be posted here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant