Ship Paseo-equivalent provider snapshot, AgentComposerBar, ACP dispatch rewrite with streaming/persist, permission prompts, and agent commands. Follow-up: pane-scoped chat resolution, CoderMessageList tool timeline, WS user-delta replace, and inference orphan tool_call stripping. Archive openspec v2-2; update CHANGELOG and CURRENT. Co-authored-by: Cursor <cursoragent@cursor.com>
48 lines
1.4 KiB
TypeScript
48 lines
1.4 KiB
TypeScript
import { describe, it, expect } from 'vitest';
|
|
import { parseCursorAgentModelsOutput } from '../cursor-models.js';
|
|
|
|
describe('parseCursorAgentModelsOutput', () => {
|
|
it('parses cursor-agent models output with default marker', () => {
|
|
const output = `
|
|
Available models
|
|
claude-4-sonnet - Claude 4 Sonnet (default)
|
|
gpt-4.1 - GPT-4.1
|
|
Tip: use cursor-agent models for full list
|
|
`.trim();
|
|
|
|
const models = parseCursorAgentModelsOutput(output);
|
|
|
|
expect(models).toEqual([
|
|
{ id: 'claude-4-sonnet', label: 'Claude 4 Sonnet', isDefault: true },
|
|
{ id: 'gpt-4.1', label: 'GPT-4.1', isDefault: false },
|
|
]);
|
|
});
|
|
|
|
it('uses current marker when no default', () => {
|
|
const output = `
|
|
model-a - Model A (current)
|
|
model-b - Model B
|
|
`.trim();
|
|
|
|
const models = parseCursorAgentModelsOutput(output);
|
|
|
|
expect(models.find((m) => m.id === 'model-a')?.isDefault).toBe(true);
|
|
expect(models.find((m) => m.id === 'model-b')?.isDefault).toBe(false);
|
|
});
|
|
|
|
it('defaults to first model when no markers', () => {
|
|
const output = 'alpha - Alpha\nbeta - Beta';
|
|
const models = parseCursorAgentModelsOutput(output);
|
|
|
|
expect(models[0]?.isDefault).toBe(true);
|
|
expect(models[1]?.isDefault).toBe(false);
|
|
});
|
|
|
|
it('skips malformed lines', () => {
|
|
const output = 'no-separator\nvalid - Valid';
|
|
const models = parseCursorAgentModelsOutput(output);
|
|
|
|
expect(models).toEqual([{ id: 'valid', label: 'Valid', isDefault: true }]);
|
|
});
|
|
});
|