feat(ai-code-review): 支援 Antigravity CLI
CI / Release Tag Version (pull_request) Successful in 4s
CI / AI Code Review (pull_request) Failing after 17s

This commit is contained in:
2026-06-27 13:47:44 +00:00
parent 5457e68065
commit 6f997083ef
8 changed files with 60 additions and 12 deletions
+12 -1
View File
@@ -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';