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(desktop): handle missing CC MCP applied generation

yan143e6b17bc87
diff --git a/apps/desktop/src/main/maker-host/__tests__/remoteCcQueryFactory.test.ts b/apps/desktop/src/main/maker-host/__tests__/remoteCcQueryFactory.test.ts
index cecab205f4..04efe8670d 100644
--- a/apps/desktop/src/main/maker-host/__tests__/remoteCcQueryFactory.test.ts
+++ b/apps/desktop/src/main/maker-host/__tests__/remoteCcQueryFactory.test.ts
@@ -164,11 +164,14 @@ describe('remoteCcQueryFactory drift override (R27 P1)', () => {
});
describe('remoteCcQueryFactory missing desired generation (Greptile R29 P1)', () => {
- it('forces a clean no-MCP query when injection cannot produce a desired fingerprint for a previously injected session', () => {
+ it('forces a clean no-MCP query when injection cannot produce a desired fingerprint', () => {
expect(source).toContain('CC_MCP_DISABLED_FINGERPRINT');
expect(source).toContain('const ccMissingDesiredStale =');
expect(source).toContain('mcpInjectFingerprint === undefined');
expect(source).toContain('ccAppliedFingerprint !== CC_MCP_DISABLED_FINGERPRINT');
+ expect(source).not.toContain(
+ 'mcpInjectFingerprint === undefined &&\n ccAppliedFingerprint !== null &&',
+ );
const missingDesired = source.indexOf('const ccMissingDesiredStale =');
const forceFreshAssign = source.indexOf('const forceFreshQuery =', missingDesired);
diff --git a/apps/desktop/src/main/maker-host/index.ts b/apps/desktop/src/main/maker-host/index.ts
index c853f171e3..52d219cac2 100644
--- a/apps/desktop/src/main/maker-host/index.ts
+++ b/apps/desktop/src/main/maker-host/index.ts
@@ -759,14 +759,14 @@ export function getMaker(): Maker {
mcpInjectFingerprint !== undefined &&
ccAppliedFingerprint !== null &&
mcpInjectFingerprint !== ccAppliedFingerprint;
- // 注入失败 / bridge 不可用时没有 desired 指纹,但若 applied 记录显示
- // 该 session 上一代确实带过 MCP,attach 旧 alive query 会复用失效
- // Authorization / URL / mcp-session-id。此时 forceFresh 成无 MCP 的
- // 干净 query,并在 open 成功后把 applied 收敛为 disabled,避免故障
- // 期间每次 open 都重复 kill + fresh (Greptile R29 P1)。
+ // 注入失败 / bridge 不可用时没有 desired 指纹,但旧 alive query 可能
+ // 仍带着上一代 MCP 配置 (老版本/首次注入尚无 applied 记录时也成立),
+ // attach 会复用失效 Authorization / URL / mcp-session-id。此时
+ // forceFresh 成无 MCP 的干净 query,并在 open 成功后把 applied 收敛
+ // 为 disabled,避免故障期间每次 open 都重复 kill + fresh
+ // (Greptile R29 P1)。
const ccMissingDesiredStale =
mcpInjectFingerprint === undefined &&
- ccAppliedFingerprint !== null &&
ccAppliedFingerprint !== CC_MCP_DISABLED_FINGERPRINT;
// 持久代际 drift (ccGenerationDrift) 不受 fresh 集合豁免:
// token/bridge/端口变化后 applied 指纹 ≠ desired 时, 已 fresh 过的