fix(ai-review model validation): 驗證 model 並支援自動選模

This commit is contained in:
2026-08-07 08:48:50 +00:00
parent 5e9bd86bbc
commit dcd80750ba
7 changed files with 55 additions and 10 deletions
+7
View File
@@ -88,6 +88,13 @@ describe('chat - CLIProxyAPI', async () => {
await assert.rejects(() => chat('sys', 'user'), /401/);
await assert.rejects(() => chat('sys', 'user'), /access token revoked/);
});
it('throws when the configured model name is invalid', async () => {
process.env.CLI_PROXY_API = 'https://proxy.example';
process.env.MODEL = 'gpt-5.5; rm -rf /';
await assert.rejects(() => chat('sys', 'user'), /無效的 model 參數/);
});
});
describe('chatJSON', async () => {