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。

chore: 合并上游 main,解决冲突

Zhang Yunjin9850ee36b963
diff --cc apps/desktop/src/renderer/__tests__/orcaModelWindowSelection.test.ts
index 5c46f04d22,b79f3e4685..2047e6af70
--- a/apps/desktop/src/renderer/__tests__/orcaModelWindowSelection.test.ts
+++ b/apps/desktop/src/renderer/__tests__/orcaModelWindowSelection.test.ts
@@@ -74,10 -74,8 +74,8 @@@ describe('Orca same-Agent window prefli
h.confirmDialog.mockResolvedValue(true);
expect(await h.pick(agent, 'small', 'provider')).toBe(true);
- // 第 8 参是 #5044 的 targetThinking 载体;本 harness 无 modelMemory →
- // 不猜、传 undefined。
expect(h.switchSessionAgent).toHaveBeenCalledWith('s1', agent, 'small', 'provider', 'high', false,
- { confirmedContextWindow: 200000 });
+ { confirmedContextWindow: 200000 }, undefined);
}
});
@@@ -119,6 -117,16 +117,16 @@@
}
});
+ it.each([false, true])('lets Codex stage a pressured switch without a handoff confirmation (remote=%s)', async remote => {
+ for (const role of ['lead', 'worker']) {
+ const h = setup({ remote, role });
+ expect(await h.pick('codex', 'small', 'provider')).toBe(true);
+ expect(h.confirmDialog).not.toHaveBeenCalled();
+ expect(h.bindings.toast.error).not.toHaveBeenCalled();
- expect(h.switchSessionAgent).toHaveBeenCalledWith('s1', 'codex', 'small', 'provider', 'high', false);
++ expect(h.switchSessionAgent).toHaveBeenCalledWith('s1', 'codex', 'small', 'provider', 'high', false, undefined, undefined);
+ }
+ });
+
it('retains legacy Pi protection and does not guard a true cross-Agent handoff', async () => {
const h = setup({ remote: true, agent: 'pi', hostGuard: false, used: 10000 });
expect(await h.pick('pi', 'small', 'provider')).toBe(false);
@@@ -149,22 -157,21 +157,21 @@@
it('does not turn an unknown target window into acknowledgement', async () => {
const h = setup({ target: Number.NaN });
expect(await h.pick('codex', 'unknown', 'provider')).toBe(true);
- expect(h.switchSessionAgent).toHaveBeenCalledWith('s1', 'codex', 'unknown', 'provider', 'high', false,
- undefined, undefined);
- expect(h.switchSessionAgent).toHaveBeenCalledWith('s1', 'codex', 'unknown', 'provider', 'high', false);
++ expect(h.switchSessionAgent).toHaveBeenCalledWith('s1', 'codex', 'unknown', 'provider', 'high', false, undefined, undefined);
});
it('rechecks a pending route when selected again, while axis-only edits skip the dialog', async () => {
- const h = setup();
- h.bindings.makerChatStore.getAgentSwitchIntent = () => ({ target: 'codex', model: 'old-model', providerId: 'old-provider' }) as never;
+ const h = setup({ agent: 'claude-code' });
+ h.bindings.makerChatStore.getAgentSwitchIntent = () => ({ target: 'claude-code', model: 'old-model', providerId: 'old-provider' }) as never;
// The callback holds the same store object; a send rejected for a changed
// window must be recoverable by selecting the pending model again.
- expect(await h.pick('codex', 'old-model', 'old-provider')).toBe(false);
+ expect(await h.pick('claude-code', 'old-model', 'old-provider')).toBe(false);
h.confirmDialog.mockResolvedValue(true);
- expect(await h.pick('codex', 'old-model', 'old-provider')).toBe(true);
- expect(h.switchSessionAgent).toHaveBeenLastCalledWith('s1', 'codex', 'old-model', 'old-provider', 'high', false,
+ expect(await h.pick('claude-code', 'old-model', 'old-provider')).toBe(true);
+ expect(h.switchSessionAgent).toHaveBeenLastCalledWith('s1', 'claude-code', 'old-model', 'old-provider', 'high', false,
- { confirmedContextWindow: 200000 });
+ { confirmedContextWindow: 200000 }, undefined);
h.confirmDialog.mockClear();
- expect(await h.pick('codex', 'old-model', 'old-provider', { effort: 'high', axesOnly: true })).toBe(true);
+ expect(await h.pick('claude-code', 'old-model', 'old-provider', { effort: 'high', axesOnly: true })).toBe(true);
expect(h.confirmDialog).not.toHaveBeenCalled();
});
});