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。

Merge pull request #5312 from makecindy/dash/migration-estimate-timeout

Lizi268fc273f352
diff --cc apps/desktop/src/main/device-link/dispatch.ts
index 188aaa04d8,42c6e32c96..42fc3d6209
--- a/apps/desktop/src/main/device-link/dispatch.ts
+++ b/apps/desktop/src/main/device-link/dispatch.ts
@@@ -2747,9 -2730,9 +2756,10 @@@ async function handleInvoke
executionPromise,
src,
payload?.channel,
+ payload?.args,
).finally(releaseBusyLease);
const inFlightEntry = {
+ channel: payload?.channel,
promise: resultPromise,
bytes: invokeBytes,
fingerprint,
diff --cc apps/desktop/src/main/task-migration/__tests__/service.test.ts
index 5cd11b44b4,de45440be2..35db37fc14
--- a/apps/desktop/src/main/task-migration/__tests__/service.test.ts
+++ b/apps/desktop/src/main/task-migration/__tests__/service.test.ts
@@@ -250,9 -268,11 +269,12 @@@ describe('resumable cross-computer copy
state.siblingRunning = false;
state.noSpace = false;
state.restoresFail = false;
+ state.exportMedia = { mediaMissing: 0, mediaDropped: 0 };
state.sharingLatest = [];
state.workers = [];
+ state.estimateLimits = [];
+ state.timeoutAction = '';
+ state.exclusions = [];
const cwd = path.join(state.root, 'shared');
await fs.mkdir(cwd);
await fs.writeFile(path.join(cwd, 'draft'), 'original');
diff --cc packages/device-link/src/invokePolicy.ts
index f0b2ff9911,e20c05b58b..012f29dc5a
--- a/packages/device-link/src/invokePolicy.ts
+++ b/packages/device-link/src/invokePolicy.ts
@@@ -1,29 -1,11 +1,33 @@@
import { INVOKE_TIMEOUT_OVERRIDES_MS } from './allowlist.js';
- import { TASK_MIGRATION_CHANNEL } from './taskMigration.js';
+ import {
+ TASK_MIGRATION_CHANNEL,
+ TASK_MIGRATION_ESTIMATE_TIMEOUT_MS,
+ TASK_MIGRATION_RECEIVE_TIMEOUT_MS,
+ } from './taskMigration.js';
import type { InvokePayload } from './protocol.js';
+/** These reads may wait behind current-task work. Not a retry or authorization policy.
+ * sessions:list also serves initial loading and recovery probes, so it stays foreground.
+ */
+const BACKGROUND_INVOKE_CHANNELS = new Set([
+ 'git-context:pr-refs:list',
+ 'git-context:pr-status',
+ 'maker:schedule:list-sidebar-index-runs',
+ 'maker:usage:device-rows',
+]);
+
+export function isBackgroundInvoke(channel: string): boolean {
+ return BACKGROUND_INVOKE_CHANNELS.has(channel);
+}
+
+/** Control traffic must not wait behind business operations to maintain a link/lease. */
+export function bypassInvokeScheduling(payload: InvokePayload): boolean {
+ if (payload.channel === 'device-link:subscribe' || payload.channel === 'device-link:unsubscribe') return true;
+ const request = payload.args?.[0];
+ return payload.channel === 'device-link:remote-desktop:v1' && !!request &&
+ typeof request === 'object' && 'op' in request && request.op === 'heartbeat';
+}
+
/**
* mobile 侧 invoke 超时解析(优先级:mobile 精确表 → schedule 前缀规则 →
* 协议契约表 → undefined = client 默认 15s)。