docs(cli): add Vercel provider to setup and doctor

This commit is contained in:
William Valentin
2026-02-15 10:53:29 -08:00
parent 87e942b4c5
commit a624f5efb5
5 changed files with 50 additions and 1 deletions
+31
View File
@@ -331,6 +331,37 @@ models:
}
});
it('reports WARN when Vercel AI Gateway has no available API key sources', async () => {
const originalKey = process.env.AI_GATEWAY_API_KEY;
delete process.env.AI_GATEWAY_API_KEY;
try {
mkdirSync(testDir, { recursive: true });
const configPath = join(testDir, 'vercel-missing.yaml');
writeFileSync(configPath, `
telegram:
bot_token: "test-token"
allowed_chat_ids: [123]
models:
default:
provider: vercel
model: openai/gpt-4.1
`);
const ctx: DoctorContext = { configPath, dataDir: testDir };
const results = await runChecks(ctx);
const modelCheck = results.find(r => r.label.includes('Model connectivity')) as CheckResult | undefined;
expect(modelCheck?.status).toBe('warn');
expect(modelCheck?.detail).toContain('AI_GATEWAY_API_KEY');
} finally {
if (originalKey) {
process.env.AI_GATEWAY_API_KEY = originalKey;
} else {
delete process.env.AI_GATEWAY_API_KEY;
}
}
});
it('reports FAIL when Anthropic auth_mode=oauth has no available auth token sources', async () => {
const originalHome = process.env.HOME;
const originalToken = process.env.ANTHROPIC_AUTH_TOKEN;