feat: rename summarize command to compact and update related descriptions for session compression
This commit is contained in:
@@ -8,6 +8,7 @@ All notable changes to this project will be documented in this file.
|
||||
- Shortcuts: Switched agent cycling shortcut from TAB to Shift + TAB.
|
||||
- Skills: added autocomplete for skills on "/" when it is not the first character in input.
|
||||
- Autocomplete: added scope badges for commands/agents/skills.
|
||||
- Compact: changed /summarize command to be /compact and use sdk for compaction.
|
||||
|
||||
|
||||
## [1.4.4] - 2026-01-08
|
||||
|
||||
@@ -458,9 +458,27 @@ export const ChatInput: React.FC<ChatInputProps> = ({ onOpenSettings, scrollToBo
|
||||
setMessage('');
|
||||
return; // Don't send to assistant
|
||||
}
|
||||
// Existing: /summarize command scroll
|
||||
else if (commandName === 'summarize') {
|
||||
scrollToBottom?.({ instant: true, force: true });
|
||||
// /compact - call SDK summarize endpoint
|
||||
else if (commandName === 'compact' && currentSessionId) {
|
||||
try {
|
||||
const { opencodeClient } = await import('@/lib/opencode/client');
|
||||
const directory = opencodeClient.getDirectory();
|
||||
const response = await opencodeClient.getApiClient().session.summarize({
|
||||
sessionID: currentSessionId,
|
||||
directory: directory || undefined,
|
||||
providerID: currentProviderId,
|
||||
modelID: currentModelId,
|
||||
});
|
||||
if (response.error) {
|
||||
throw new Error('Failed to compact session');
|
||||
}
|
||||
scrollToBottom?.({ instant: true, force: true });
|
||||
} catch (error) {
|
||||
console.error('Failed to compact session:', error);
|
||||
toast.error('Failed to compact session');
|
||||
}
|
||||
setMessage('');
|
||||
return; // Don't send to assistant
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -144,7 +144,7 @@ const ChatMessage: React.FC<ChatMessageProps> = ({
|
||||
return message.parts.map((part) => {
|
||||
const rawPart = part as Record<string, unknown>;
|
||||
if (rawPart.type === 'compaction') {
|
||||
return { type: 'text', text: '/summarize' } as Part;
|
||||
return { type: 'text', text: '/compact' } as Part;
|
||||
}
|
||||
return part;
|
||||
});
|
||||
|
||||
@@ -98,7 +98,7 @@ export const CommandAutocomplete = React.forwardRef<CommandAutocompleteHandle, C
|
||||
]
|
||||
: []
|
||||
),
|
||||
{ name: 'summarize', description: 'Generate a summary of the current session', isBuiltIn: true },
|
||||
{ name: 'compact', description: 'Compress session history using AI to reduce context size', isBuiltIn: true },
|
||||
];
|
||||
|
||||
const commandMap = new Map<string, CommandInfo>();
|
||||
@@ -142,7 +142,7 @@ export const CommandAutocomplete = React.forwardRef<CommandAutocompleteHandle, C
|
||||
]
|
||||
: []
|
||||
),
|
||||
{ name: 'summarize', description: 'Generate a summary of the current session', isBuiltIn: true },
|
||||
{ name: 'compact', description: 'Compress session history using AI to reduce context size', isBuiltIn: true },
|
||||
];
|
||||
|
||||
const filtered = (searchQuery
|
||||
@@ -215,7 +215,7 @@ export const CommandAutocomplete = React.forwardRef<CommandAutocompleteHandle, C
|
||||
return <RiArrowGoForwardLine className="h-3.5 w-3.5 text-orange-500" />;
|
||||
case 'timeline':
|
||||
return <RiTimeLine className="h-3.5 w-3.5 text-blue-500" />;
|
||||
case 'summarize':
|
||||
case 'compact':
|
||||
return <RiScissorsLine className="h-3.5 w-3.5 text-purple-500" />;
|
||||
case 'test':
|
||||
case 'build':
|
||||
|
||||
Reference in New Issue
Block a user