fix(ai-review model validation): 驗證 model 並支援自動選模
This commit is contained in:
@@ -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 () => {
|
||||
|
||||
Reference in New Issue
Block a user