mirror of
https://github.com/tiennm99/ccs.git
synced 2026-10-17 10:14:08 +00:00
fix(cursor): address remaining PR #527 review feedback
- Add SIGKILL escalation in stopDaemon after SIGTERM timeout - Document router difference between cursor/copilot help behavior - Fix detectProvider to handle o1/o4 models via regex pattern - Add fetchModelsFromDaemon fallback test for unreachable daemon - Update CLAUDE.md help table with cursor command entry
This commit is contained in:
1 parent
9f9db7dcea
commit
afb5e746b3
5 files changed
+29
-1
No files matched your search
@@ -10,6 +10,7 @@ import {
|
||||
getDefaultModel,
|
||||
detectProvider,
|
||||
formatModelName,
|
||||
fetchModelsFromDaemon,
|
||||
} from '../../../src/cursor/cursor-models';
|
||||
|
||||
describe('DEFAULT_CURSOR_MODELS', () => {
|
||||
@@ -57,6 +58,12 @@ describe('detectProvider', () => {
|
||||
expect(detectProvider('o3-mini')).toBe('openai');
|
||||
});
|
||||
|
||||
it('detects o1 and o4 models as openai', () => {
|
||||
expect(detectProvider('o1')).toBe('openai');
|
||||
expect(detectProvider('o1-preview')).toBe('openai');
|
||||
expect(detectProvider('o4-mini')).toBe('openai');
|
||||
});
|
||||
|
||||
it('detects google models', () => {
|
||||
expect(detectProvider('gemini-2.5-pro')).toBe('google');
|
||||
});
|
||||
@@ -80,3 +87,13 @@ describe('formatModelName', () => {
|
||||
expect(formatModelName('my-custom-model')).toBe('My Custom Model');
|
||||
});
|
||||
});
|
||||
|
||||
describe('fetchModelsFromDaemon', () => {
|
||||
it('falls back to DEFAULT_CURSOR_MODELS when daemon is unreachable', async () => {
|
||||
// Use a port that nothing is listening on
|
||||
const unreachablePort = 9999;
|
||||
const models = await fetchModelsFromDaemon(unreachablePort);
|
||||
|
||||
expect(models).toEqual(DEFAULT_CURSOR_MODELS);
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user