diff options
| author | Seth Troisi <[email protected]> | 2025-07-01 17:17:08 -0700 |
|---|---|---|
| committer | GitHub <[email protected]> | 2025-07-02 00:17:08 +0000 |
| commit | 38445f63f00c42a9abf42b3e436d47eb39a01745 (patch) | |
| tree | b7d716ebbace811ada2f829bce0586471a918fe7 /packages/cli/src/ui/hooks/slashCommandProcessor.ts | |
| parent | 34935d6558dfca743e457ecd7684d0aab69f1c1b (diff) | |
make tag required for /chat (#2904)
Diffstat (limited to 'packages/cli/src/ui/hooks/slashCommandProcessor.ts')
| -rw-r--r-- | packages/cli/src/ui/hooks/slashCommandProcessor.ts | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/packages/cli/src/ui/hooks/slashCommandProcessor.ts b/packages/cli/src/ui/hooks/slashCommandProcessor.ts index ffc3d7d1..01378d89 100644 --- a/packages/cli/src/ui/hooks/slashCommandProcessor.ts +++ b/packages/cli/src/ui/hooks/slashCommandProcessor.ts @@ -699,7 +699,7 @@ export const useSlashCommandProcessor = ( { name: 'chat', description: - 'Manage conversation history. Usage: /chat <list|save|resume> [tag]', + 'Manage conversation history. Usage: /chat <list|save|resume> <tag>', action: async (_mainCommand, subCommand, args) => { const tag = (args || '').trim(); const logger = new Logger(config?.getSessionId() || ''); @@ -716,19 +716,27 @@ export const useSlashCommandProcessor = ( if (!subCommand) { addMessage({ type: MessageType.ERROR, - content: 'Missing command\nUsage: /chat <list|save|resume> [tag]', + content: 'Missing command\nUsage: /chat <list|save|resume> <tag>', timestamp: new Date(), }); return; } switch (subCommand) { case 'save': { + if (!tag) { + addMessage({ + type: MessageType.ERROR, + content: 'Missing tag. Usage: /chat save <tag>', + timestamp: new Date(), + }); + return; + } const history = chat.getHistory(); if (history.length > 0) { await logger.saveCheckpoint(chat?.getHistory() || [], tag); addMessage({ type: MessageType.INFO, - content: `Conversation checkpoint saved${tag ? ' with tag: ' + tag : ''}.`, + content: `Conversation checkpoint saved with tag: ${tag}.`, timestamp: new Date(), }); } else { @@ -743,11 +751,19 @@ export const useSlashCommandProcessor = ( case 'resume': case 'restore': case 'load': { + if (!tag) { + addMessage({ + type: MessageType.ERROR, + content: 'Missing tag. Usage: /chat resume <tag>', + timestamp: new Date(), + }); + return; + } const conversation = await logger.loadCheckpoint(tag); if (conversation.length === 0) { addMessage({ type: MessageType.INFO, - content: `No saved checkpoint found${tag ? ' with tag: ' + tag : ''}.`, + content: `No saved checkpoint found with tag: ${tag}.`, timestamp: new Date(), }); return; |
