Consider it done. The open-source AI agent that works out of the box · 想到,就能做到。开源、开箱即用的 AI Agent。
TypeScript agentai-agentai-assistantandroidclaude-codecodexelectroniosllmmacosreact-nativetypescriptwindows
fix(orca): 组选回的当前位置在另一台电脑时提交带上位置
fmfsaisaid7ac0545f59f
diff --git a/apps/desktop/src/main/maker-ipc/__tests__/sessionAgentSwitchHandler.test.ts b/apps/desktop/src/main/maker-ipc/__tests__/sessionAgentSwitchHandler.test.tsindex f8d4f0eb56..90c4534bd0 100644--- a/apps/desktop/src/main/maker-ipc/__tests__/sessionAgentSwitchHandler.test.ts+++ b/apps/desktop/src/main/maker-ipc/__tests__/sessionAgentSwitchHandler.test.ts@@ -1750,6 +1750,25 @@ describe('换到供应商组那一项:由组选一台能用的电脑(provider-expect(commitBinding).toHaveBeenCalledTimes(1);expect(pending.get('s1')).toBeUndefined();});++ it('协同任务已在另一台电脑:组选回那台时提交带上位置,窗口按那台的目录判断', async () => {+ const pending = createPendingAgentSwitchRegistry();+ const row = makeRow({ agentKind: 'cc', model: 'claude-fable-5', providerId: 'xd', agentDeviceId: 'studio-mac', orcaRole: 'lead' });+ const { deps } = makeDeps({+ pendingSwitches: pending,+ getSessionRow: vi.fn(async () => row),+ assertAgentDeviceRouteUsable: vi.fn(async () => undefined),+ resolveProviderGroupTarget: vi.fn(async () => ({ agentDeviceId: 'studio-mac', providerId: 'xd' })),+ selectSameAgentModel: vi.fn(async () => ({ deferred: false })),+ });+ await performSessionAgentSwitch(deps, { ...toGroup, model: 'claude-haiku-5-5' });+ await applyPendingAgentSwitchIfIdle(deps, 's1');+ expect(deps.applyAgentSwitchToDb).toHaveBeenCalledWith('s1', expect.objectContaining({+ model: 'claude-haiku-5-5',+ agentDeviceId: 'studio-mac',+ sdkSessionId: null,+ }));+ });});describe('relocateForFreshStart (opening a task elsewhere when its own computer failed to start)', () => {diff --git a/apps/desktop/src/main/maker-ipc/sessionAgentSwitchHandler.ts b/apps/desktop/src/main/maker-ipc/sessionAgentSwitchHandler.tsindex 55fff4dea0..c2f75f1127 100644--- a/apps/desktop/src/main/maker-ipc/sessionAgentSwitchHandler.ts+++ b/apps/desktop/src/main/maker-ipc/sessionAgentSwitchHandler.ts@@ -887,7 +887,10 @@ export async function performSessionAgentSwitch(sdkSessionId: parked?.sdkSessionId ?? null,...(typeof params.effort === 'string' && params.effort ? { effort: params.effort } : {}),...(typeof params.fastMode === 'boolean' ? { fastMode: params.fastMode } : {}),- ...(agentDeviceChanges ? { agentDeviceId: targetAgentDeviceId } : {}),+ // 组选回的当前位置在另一台电脑时也带上位置:提交按它判断窗口该查哪台的目录,不能拿本机目录。+ ...(agentDeviceChanges || (orcaGroupReturnRebuild && targetAgentDeviceId)+ ? { agentDeviceId: targetAgentDeviceId }+ : {}),});if (normalizedProviderId !== undefined) {deps.setSessionProvider(sessionId, normalizedProviderId);