Skip to content
This repository was archived by the owner on Aug 6, 2026. It is now read-only.

feat: add /new to clear chat - #3527

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

feat: add /new to clear chat#3527
igennova wants to merge 4 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 PostHog/posthog#76323

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

@github-actions

Copy link
Copy Markdown

This PR has had no activity for 7 days and has been marked stale. We are moving to the monorepo and tightening PR staleness in preparation, so it will be closed in 7 days if no further activity occurs.

@github-actions github-actions Bot added the stale No recent changes to PR label Jul 27, 2026
@charlesvien

Copy link
Copy Markdown
Member

Closing stale PRs ahead of Friday's monorepo migration. If this is a mistake, rebase and reopen for review.

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

Labels

stale No recent changes to PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants