fix stale state in /rewind

This commit is contained in:
Your Name
2026-04-30 20:20:15 +00:00
parent 0ccc5ce58f
commit 602d6858f9
8 changed files with 196 additions and 9 deletions
@@ -577,7 +577,7 @@ describe('useSlashCommandProcessor', () => {
it('should handle "load_history" action', async () => {
const mockClient = {
setHistory: vi.fn(),
resumeChat: vi.fn().mockResolvedValue(undefined),
stripThoughtsFromHistory: vi.fn(),
} as unknown as GeminiClient;
vi.spyOn(mockConfig, 'getGeminiClient').mockReturnValue(mockClient);
@@ -549,7 +549,9 @@ export const useSlashCommandProcessor = (
}
}
case 'load_history': {
config?.getGeminiClient()?.setHistory(result.clientHistory);
await config
?.getGeminiClient()
?.resumeChat(result.clientHistory);
fullCommandContext.ui.clear();
result.history.forEach((item, index) => {
fullCommandContext.ui.addItem(item, index);