Fix: Restore views properly, model selection for commit and pr and speed up some cli models with session resume (#801)

* Changes from fix/restoring-view

* feat: Add resume query safety checks and optimize store selectors

* feat: Improve session management and model normalization

* refactor: Extract prompt building logic and handle file path parsing for renames
This commit is contained in:
gsxdsm
2026-02-22 10:45:45 -08:00
committed by GitHub
parent 2f071a1ba3
commit 9305ecc242
26 changed files with 761 additions and 203 deletions

View File

@@ -303,6 +303,36 @@ describe('agent-service.ts', () => {
expect(fs.writeFile).toHaveBeenCalled();
});
it('should include context/history preparation for Gemini requests', async () => {
let capturedOptions: any;
const mockProvider = {
getName: () => 'gemini',
executeQuery: async function* (options: any) {
capturedOptions = options;
yield {
type: 'result',
subtype: 'success',
};
},
};
vi.mocked(ProviderFactory.getProviderForModelName).mockReturnValue('gemini');
vi.mocked(ProviderFactory.getProviderForModel).mockReturnValue(mockProvider as any);
vi.mocked(promptBuilder.buildPromptWithImages).mockResolvedValue({
content: 'Hello',
hasImages: false,
});
await service.sendMessage({
sessionId: 'session-1',
message: 'Hello',
model: 'gemini-2.5-flash',
});
expect(contextLoader.loadContextFiles).toHaveBeenCalled();
expect(capturedOptions).toBeDefined();
});
});
describe('stopExecution', () => {