feat(ai-code-review): 支援 Antigravity CLI
This commit is contained in:
+12
-1
@@ -1,6 +1,6 @@
|
||||
import { describe, it, beforeEach, afterEach } from 'node:test';
|
||||
import assert from 'node:assert/strict';
|
||||
import { getLLMConfig, getOpenCodeHttpsAgent } from '../config.js';
|
||||
import { getLLMCLICommands, getLLMConfig, getOpenCodeHttpsAgent } from '../config.js';
|
||||
|
||||
const ENV_KEYS = [
|
||||
'AI_ASSISTANT_CLI', 'MODEL', 'OPENCODE_MODEL',
|
||||
@@ -19,6 +19,10 @@ afterEach(() => {
|
||||
});
|
||||
|
||||
describe('getLLMConfig', () => {
|
||||
it('exports the supported assistant CLI commands', () => {
|
||||
assert.deepEqual(getLLMCLICommands(), ['codex', 'claude', 'agy', 'antigravity', 'opencode']);
|
||||
});
|
||||
|
||||
it('returns null provider when no env vars set', () => {
|
||||
const cfg = getLLMConfig({ commandExistsFn: () => false });
|
||||
assert.equal(cfg.provider, null);
|
||||
@@ -43,6 +47,13 @@ describe('getLLMConfig', () => {
|
||||
assert.equal(cfg.model, 'gpt-5-mini');
|
||||
});
|
||||
|
||||
it('detects Antigravity through the agy command', () => {
|
||||
const cfg = getLLMConfig({ commandExistsFn: command => command === 'agy' });
|
||||
assert.equal(cfg.provider, 'antigravity');
|
||||
assert.equal(cfg.command, 'agy');
|
||||
assert.equal(cfg.model, 'gemini-2.5-flash');
|
||||
});
|
||||
|
||||
it('can force a CLI with AI_ASSISTANT_CLI', () => {
|
||||
process.env.AI_ASSISTANT_CLI = 'opencode';
|
||||
process.env.OPENCODE_MODEL = 'google/gemini-2.5-pro';
|
||||
|
||||
Reference in New Issue
Block a user