Skip to content

The agent that grows with you

fix(desktop): make /clear start a new session like /new

686f6c614a410b844b53
diff --git a/apps/desktop/src/lib/desktop-slash-commands.test.ts b/apps/desktop/src/lib/desktop-slash-commands.test.ts
index fed673d9e8c..9225b43dab4 100644
--- a/apps/desktop/src/lib/desktop-slash-commands.test.ts
+++ b/apps/desktop/src/lib/desktop-slash-commands.test.ts
@@ -180,6 +180,12 @@ describe('desktop slash command curation', () => {
it('allows aliases to execute without cluttering the popover', () => {
expect(isDesktopSlashSuggestion('/reset')).toBe(false)
expect(isDesktopSlashCommand('/reset')).toBe(true)
+ // Help advertises `/clear` as "start a new session". On the TUI that
+ // also clears the terminal screen; on desktop it must take the same
+ // path as `/new` instead of being marked terminal-only (#95779).
+ expect(isDesktopSlashSuggestion('/clear')).toBe(false)
+ expect(isDesktopSlashCommand('/clear')).toBe(true)
+ expect(resolveDesktopCommand('/clear')?.surface).toEqual({ kind: 'action', action: 'new' })
})
it('surfaces an alias the user typed exactly, gated on desktop availability (#57641)', () => {
@@ -297,9 +303,10 @@ describe('desktop slash command curation', () => {
it('resolves commands and aliases to their declared surface', () => {
expect(resolveDesktopCommand('/new')?.surface).toEqual({ kind: 'action', action: 'new' })
expect(resolveDesktopCommand('/reset')?.surface).toEqual({ kind: 'action', action: 'new' })
+ expect(resolveDesktopCommand('/clear')?.surface).toEqual({ kind: 'action', action: 'new' })
expect(resolveDesktopCommand('/resume')?.surface).toEqual({ kind: 'picker', picker: 'session' })
expect(resolveDesktopCommand('/usage')?.surface).toEqual({ kind: 'exec' })
- expect(resolveDesktopCommand('/clear')?.surface).toEqual({ kind: 'unavailable', reason: 'terminal' })
+ expect(desktopSlashUnavailableMessage('/clear')).toBeNull()
// Skill / quick commands aren't in the registry.
expect(resolveDesktopCommand('/gif-search')).toBeNull()
})
diff --git a/apps/desktop/src/lib/desktop-slash-commands.ts b/apps/desktop/src/lib/desktop-slash-commands.ts
index 06182577483..a5e0409bc3f 100644
--- a/apps/desktop/src/lib/desktop-slash-commands.ts
+++ b/apps/desktop/src/lib/desktop-slash-commands.ts
@@ -178,7 +178,7 @@ const rpc = (
*/
const DESKTOP_COMMAND_SPECS: readonly DesktopCommandSpec[] = [
// Local client actions
- { name: '/new', description: 'Start a new desktop chat', aliases: ['/reset'], surface: action('new') },
+ { name: '/new', description: 'Start a new desktop chat', aliases: ['/reset', '/clear'], surface: action('new') },
{
name: '/stop',
description: 'Stop the active turn and background processes',