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(pi): SuperGrok catalog addition 要求探针里真有 xAI 基线

Dash111108cb42be
diff --git a/apps/desktop/src/main/maker-host/__tests__/piNativeProviders.test.ts b/apps/desktop/src/main/maker-host/__tests__/piNativeProviders.test.ts
index d42614adb8..0a60c6bc00 100644
--- a/apps/desktop/src/main/maker-host/__tests__/piNativeProviders.test.ts
+++ b/apps/desktop/src/main/maker-host/__tests__/piNativeProviders.test.ts
@@ -497,6 +497,22 @@ describe('buildPiNativeProvidersFromConfigs', () => {
expect(xaiProvider?.models.find((model) => model.id === 'grok-4.5')?.catalogAddition).toBeUndefined();
});
+ it('does not mark SuperGrok models as catalog additions when the probe has no xAI baseline', () => {
+ const catalog = JSON.parse(JSON.stringify(BUNDLED_CATALOG)) as Catalog;
+
+ const { providers } = buildPiSubscriptionNativeProviders(
+ catalog,
+ 'http://127.0.0.1:4567/',
+ new Map([
+ ['anthropic', new Map([['claude-opus-5', piBundledModel('claude-opus-5', 'anthropic-messages')]])],
+ ]),
+ );
+
+ const xaiProvider = providers.find((provider) => provider.id === 'xai');
+ expect(xaiProvider?.models.find((model) => model.id === 'grok-4.6')?.catalogAddition).toBeUndefined();
+ expect(xaiProvider?.models.find((model) => model.id === 'grok-4.5')?.catalogAddition).toBeUndefined();
+ });
+
it('namespaces only colliding BYOM runtime ids and preserves their persisted source ids', () => {
const collisions: Array<[string, string]> = [];
const merged = mergePiNativeProviderResults(
diff --git a/apps/desktop/src/main/maker-host/pi-host.ts b/apps/desktop/src/main/maker-host/pi-host.ts
index bc8bcef847..00979b7405 100644
--- a/apps/desktop/src/main/maker-host/pi-host.ts
+++ b/apps/desktop/src/main/maker-host/pi-host.ts
@@ -497,13 +497,10 @@ export function buildPiSubscriptionNativeProviders(
// SuperGrok 没有官方列模型通道,Cindy 目录是成员唯一来源。
// PI 二进制常常跟不上新 Grok id(grok-4.6):inheritModels
// 会把没有 piApi 的行从 models.json 滤掉,spawn 靠 custom
- // model id 能跑,set_model 却 fail-closed。只有探针成功证明
- // 这个 PI 二进制没有该 id 时才标 catalog addition;探针失败
- // 时 bundledModelsByProvider 为 undefined,不得把已收录模型
- // 的权威元数据冲掉,仍走上面的 annotated-only 路径。
- ...(sourceProviderId === 'xai' &&
- bundledModelsByProvider != null &&
- !bundledModel
+ // model id 能跑,set_model 却 fail-closed。只有探针成功且
+ // 这份结果里真有 xAI 行,才能把缺 id 当成有效证明;总表
+ // 非空但 xAI 被畸形数据整表跳过时,仍走 annotated-only。
+ ...(sourceProviderId === 'xai' && bundledModels != null && !bundledModel
? { catalogAddition: true }
: {}),
...(sourceProviderId !== 'openai' &&