Skip to content

The agent that grows with you

fix(desktop): Move to project refuses by name on the shared gateway instead of a false success

Teknium58eea0f4d5ba
diff --git a/apps/desktop/src/api/canonical-producer-contract.test.ts b/apps/desktop/src/api/canonical-producer-contract.test.ts
index a808da45571..dd5441e76d0 100644
--- a/apps/desktop/src/api/canonical-producer-contract.test.ts
+++ b/apps/desktop/src/api/canonical-producer-contract.test.ts
@@ -165,6 +165,12 @@ const SITES: Array<[string, string, Record<string, unknown>, string[] | RegExp]>
{ session_id: 's', url: 'http://x' },
/preview\.restart is not available/
],
+ [
+ 'projects.ts moveSessionToProject (B21 / C-hx-2)',
+ 'session.workspace.move',
+ { cwd: '/repo', session_key: 's' },
+ /Moving a chat to another project is not available/
+ ],
[
'connector-tool.tsx in-chat connect',
'connectors.connect',
diff --git a/apps/desktop/src/api/canonical-protocol.ts b/apps/desktop/src/api/canonical-protocol.ts
index ec3bb771c95..f791dee4b20 100644
--- a/apps/desktop/src/api/canonical-protocol.ts
+++ b/apps/desktop/src/api/canonical-protocol.ts
@@ -151,6 +151,12 @@ function canonicalProducerFrame(method: string, params: Record<string, unknown>)
throw new Error(`Changing ${params.key}${'scope' in params ? ` (${params.scope})` : ''} is not available on the shared gateway yet`)
}
+ // The sidecar's move rewrites only the stored row: the owner's frozen policy (execution cwd,
+ // TERMINAL_CWD, resume) would stay on the old folder while the sidebar showed the new one.
+ if (method === 'session.workspace.move') {
+ throw new Error('Moving a chat to another project is not available on the shared gateway yet')
+ }
+
if (SIDECAR_SESSION_VERBS.has(method) || (method.startsWith('connect') && (params.owner as { type?: unknown } | undefined)?.type === 'session')) {
throw new Error(`${method} is not available on the shared gateway yet`)
}