mirror of
https://github.com/AutoMaker-Org/automaker.git
synced 2026-03-19 22:53:08 +00:00
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:
39
apps/server/tests/unit/providers/cursor-provider.test.ts
Normal file
39
apps/server/tests/unit/providers/cursor-provider.test.ts
Normal file
@@ -0,0 +1,39 @@
|
||||
import { describe, it, expect } from 'vitest';
|
||||
import { CursorProvider } from '@/providers/cursor-provider.js';
|
||||
|
||||
describe('cursor-provider.ts', () => {
|
||||
describe('buildCliArgs', () => {
|
||||
it('adds --resume when sdkSessionId is provided', () => {
|
||||
const provider = Object.create(CursorProvider.prototype) as CursorProvider & {
|
||||
cliPath?: string;
|
||||
};
|
||||
provider.cliPath = '/usr/local/bin/cursor-agent';
|
||||
|
||||
const args = provider.buildCliArgs({
|
||||
prompt: 'Continue the task',
|
||||
model: 'gpt-5',
|
||||
cwd: '/tmp/project',
|
||||
sdkSessionId: 'cursor-session-123',
|
||||
});
|
||||
|
||||
const resumeIndex = args.indexOf('--resume');
|
||||
expect(resumeIndex).toBeGreaterThan(-1);
|
||||
expect(args[resumeIndex + 1]).toBe('cursor-session-123');
|
||||
});
|
||||
|
||||
it('does not add --resume when sdkSessionId is omitted', () => {
|
||||
const provider = Object.create(CursorProvider.prototype) as CursorProvider & {
|
||||
cliPath?: string;
|
||||
};
|
||||
provider.cliPath = '/usr/local/bin/cursor-agent';
|
||||
|
||||
const args = provider.buildCliArgs({
|
||||
prompt: 'Start a new task',
|
||||
model: 'gpt-5',
|
||||
cwd: '/tmp/project',
|
||||
});
|
||||
|
||||
expect(args).not.toContain('--resume');
|
||||
});
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user