Skip to content

armgit / cindy

Public Imported from GitHub
0

Consider it done. The open-source AI agent that works out of the box · 想到,就能做到。开源、开箱即用的 AI Agent。

fix(providers): align diagnostic model route paths

Chrisc774cd217ee2
diff --git a/apps/desktop/src/main/maker-host/__tests__/providerDiagnostics.test.ts b/apps/desktop/src/main/maker-host/__tests__/providerDiagnostics.test.ts
index 4441b27996..9223b7c68f 100644
--- a/apps/desktop/src/main/maker-host/__tests__/providerDiagnostics.test.ts
+++ b/apps/desktop/src/main/maker-host/__tests__/providerDiagnostics.test.ts
@@ -434,6 +434,7 @@ describe('resolveSavedProbeSpec / testProviderConnection(saved)', () => {
codex: {
baseUrl: 'https://open.bigmodel.cn/api/coding/paas/v4',
wireProtocol: 'openai-chat',
+ requestPath: '/legacy/chat',
models: [
{
id: 'glm-5.3',
@@ -441,7 +442,6 @@ describe('resolveSavedProbeSpec / testProviderConnection(saved)', () => {
route: {
baseUrl: 'https://open.bigmodel.cn/api/v1',
wireProtocol: 'openai-responses',
- requestPath: '/responses',
},
},
],
@@ -455,7 +455,7 @@ describe('resolveSavedProbeSpec / testProviderConnection(saved)', () => {
baseUrl: 'https://open.bigmodel.cn/api/v1',
modelId: 'glm-5.3',
wireProtocol: 'openai-responses',
- requestPath: '/responses',
+ requestPath: undefined,
});
let seenUrl = '';
await testProviderConnection(
@@ -477,6 +477,7 @@ describe('resolveSavedProbeSpec / testProviderConnection(saved)', () => {
codex: {
baseUrl: 'https://open.bigmodel.cn/api/coding/paas/v4',
wireProtocol: 'openai-chat',
+ requestPath: '/chat/completions',
models: [{ id: 'glm-5.2', name: 'GLM-5.2' }],
},
},
@@ -488,6 +489,7 @@ describe('resolveSavedProbeSpec / testProviderConnection(saved)', () => {
baseUrl: 'https://open.bigmodel.cn/api/coding/paas/v4',
modelId: 'glm-5.2',
wireProtocol: 'openai-chat',
+ requestPath: '/chat/completions',
});
let seenUrl = '';
await testProviderConnection(
diff --git a/apps/desktop/src/main/maker-host/provider-diagnostics.ts b/apps/desktop/src/main/maker-host/provider-diagnostics.ts
index d697f1ded5..1923097c10 100644
--- a/apps/desktop/src/main/maker-host/provider-diagnostics.ts
+++ b/apps/desktop/src/main/maker-host/provider-diagnostics.ts
@@ -338,7 +338,9 @@ export function resolveSavedProbeSpec(providerId: string, agent: AgentKind): Pro
// Pi derives its inference path from wireProtocol and does not consume requestPath.
const requestPath = agent === 'pi'
? undefined
- : (model.route?.requestPath ?? routing.requestPath);
+ : model.route
+ ? model.route.requestPath
+ : routing.requestPath;
// OAuth 形态:探测凭证用 Runner 持有的 access_token(与 oauth-token 路由同源),未登录时
// 无 token → 探测会得到 AUTH_INVALID,这本身就是「先去登录」的正确结论。
// token 走 authorization 头而**不走 apiKey 字段**——apiKey 会让 cc 探测同时发