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 补 appliedContextWindowBudgets 注入(#4598)

Zhang Yunjince768749dbbf
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 fd0142cb58..7cce5d87d8 100644
--- a/apps/desktop/src/main/maker-ipc/__tests__/orcaModelSelectionIntent.test.ts
+++ b/apps/desktop/src/main/maker-ipc/__tests__/orcaModelSelectionIntent.test.ts
@@ -204,6 +204,7 @@ describe('complete selection commit boundaries', () => {
applyScheduledProfile: apply, contextOverflowRolloverHolder: null,
// 发送边界的预算对账(register.ts):本用例只关心路由选择,注入 no-op。
reconcileSessionContextWindowBudgetUnderLock: vi.fn(async () => {}),
+ appliedContextWindowBudgets: new Map<string, number | null>(),
});
const directSend = compile(directSendEntry, { pendingAgentSwitchApplyHolder: adapter });
const lease = await directSend('scheduled-task', undefined,
@@ -240,7 +241,8 @@ describe('complete selection commit boundaries', () => {
restoreArchivedSessionForSend: async () => { status = 'active'; },
reconcileBotModelRoute: vi.fn(), applyPendingAgentSwitchIfIdle, isUserPendingAgentSwitchIntent,
agentSwitchDeps: deps, contextOverflowRolloverHolder: null,
- reconcileSessionContextWindowBudgetUnderLock: vi.fn(async () => {}) });
+ reconcileSessionContextWindowBudgetUnderLock: vi.fn(async () => {}),
+ appliedContextWindowBudgets: new Map<string, number | null>() });
const sending = directSend('queued-picker');
finishPicker();
await picker;
@@ -339,6 +341,7 @@ describe('Orca model-only picker intent admission', () => {
acquireSendToSessionLock: acquire, reconcileBotModelRoute: vi.fn(),
applyPendingAgentSwitchIfIdle, isUserPendingAgentSwitchIntent, agentSwitchDeps: deps, contextOverflowRolloverHolder: null,
reconcileSessionContextWindowBudgetUnderLock: vi.fn(async () => {}),
+ appliedContextWindowBudgets: new Map<string, number | null>(),
});
if (mode === 'cross-engine' || mode === 'relocation') {
const stageAxis = compile(stageAxisAdapter, { ...axisCatalogBindings(row), agentSwitchPending: pending, agentSwitchDeps: deps,