fix(ai-review model validation): 驗證 model 並支援自動選模
This commit is contained in:
@@ -208,6 +208,20 @@ describe('verifyLLM', () => {
|
||||
assert.match(result.error, /不在 CLIProxyAPI 可用清單/);
|
||||
assert.match(result.error, /gpt-9-imaginary/);
|
||||
});
|
||||
|
||||
it('fails when the configured model name is invalid', async () => {
|
||||
clearLLMEnv();
|
||||
process.env.CLI_PROXY_API = 'https://proxy.example';
|
||||
process.env.MODEL = 'gpt-5.5; rm -rf /';
|
||||
|
||||
const result = await verifyLLM({
|
||||
fetchLLMModelsFn: async () => ({ ok: true, slugs: ['gpt-5.5'] }),
|
||||
});
|
||||
|
||||
assert.equal(result.ok, false);
|
||||
assert.equal(result.provider, 'cliproxyapi');
|
||||
assert.match(result.error, /無效的 model 參數/);
|
||||
});
|
||||
});
|
||||
|
||||
describe('runPreflight', () => {
|
||||
|
||||
Reference in New Issue
Block a user