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。

test(desktop): orcaModelSelectionIntent 注入发送边界预算对账的 no-op 依赖(#4598)

Zhang Yunjin8dfbb0016a32
diff --git a/apps/desktop/src/main/maker-ipc/__tests__/orcaModelSelectionIntent.test.ts b/apps/desktop/src/main/maker-ipc/__tests__/orcaModelSelectionIntent.test.ts
index 1b3cf21a3e..fd0142cb58 100644
--- a/apps/desktop/src/main/maker-ipc/__tests__/orcaModelSelectionIntent.test.ts
+++ b/apps/desktop/src/main/maker-ipc/__tests__/orcaModelSelectionIntent.test.ts
@@ -202,6 +202,8 @@ describe('complete selection commit boundaries', () => {
isUserPendingAgentSwitchIntent, reconcileBotModelRoute: vi.fn(),
applyPendingAgentSwitchIfIdle: vi.fn(), agentSwitchDeps: {},
applyScheduledProfile: apply, contextOverflowRolloverHolder: null,
+ // 发送边界的预算对账(register.ts):本用例只关心路由选择,注入 no-op。
+ reconcileSessionContextWindowBudgetUnderLock: vi.fn(async () => {}),
});
const directSend = compile(directSendEntry, { pendingAgentSwitchApplyHolder: adapter });
const lease = await directSend('scheduled-task', undefined,
@@ -237,7 +239,8 @@ describe('complete selection commit boundaries', () => {
scheduledModelScope: { restore: vi.fn(async () => {}) },
restoreArchivedSessionForSend: async () => { status = 'active'; },
reconcileBotModelRoute: vi.fn(), applyPendingAgentSwitchIfIdle, isUserPendingAgentSwitchIntent,
- agentSwitchDeps: deps, contextOverflowRolloverHolder: null });
+ agentSwitchDeps: deps, contextOverflowRolloverHolder: null,
+ reconcileSessionContextWindowBudgetUnderLock: vi.fn(async () => {}) });
const sending = directSend('queued-picker');
finishPicker();
await picker;
@@ -335,6 +338,7 @@ describe('Orca model-only picker intent admission', () => {
agentSwitchPending: pending, restoreArchivedSessionForSend: restore,
acquireSendToSessionLock: acquire, reconcileBotModelRoute: vi.fn(),
applyPendingAgentSwitchIfIdle, isUserPendingAgentSwitchIntent, agentSwitchDeps: deps, contextOverflowRolloverHolder: null,
+ reconcileSessionContextWindowBudgetUnderLock: vi.fn(async () => {}),
});
if (mode === 'cross-engine' || mode === 'relocation') {
const stageAxis = compile(stageAxisAdapter, { ...axisCatalogBindings(row), agentSwitchPending: pending, agentSwitchDeps: deps,