From b996cf5fea14dcd63665c903b49db3576f0caa56 Mon Sep 17 00:00:00 2001 From: BlitzOS Upstream Prep Date: Wed, 2 Sep 2026 00:25:16 +0000 Subject: [PATCH] feat(components): open the local file handoff to a non-Electron bridge `canUseElectronLocalFileSend` is the gate on the attachment fast path that hands bytes to the machine running the session instead of uploading them. It asks two questions: is this Electron, and is there an IPC bridge. Only the second one is about the transport. Accept `window.__LODY_LOCAL_BRIDGE__` beside `isElectronRenderer()`, keeping the `Boolean(getIpcServices())` term that decides whether the channel exists at all. The `typeof window` guard is not decoration: `isElectronRenderer()` carries one, and without it the module would throw where it used to answer false. Model: claude-opus-5[1m] --- packages/components/src/lib/electron-session-file-sender.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/components/src/lib/electron-session-file-sender.ts b/packages/components/src/lib/electron-session-file-sender.ts index 7c896ab63..39604ec10 100644 --- a/packages/components/src/lib/electron-session-file-sender.ts +++ b/packages/components/src/lib/electron-session-file-sender.ts @@ -17,7 +17,9 @@ import { getIpcServices } from './electron-ipc-client'; */ export const canUseElectronLocalFileSend = (): boolean => - isElectronRenderer() && Boolean(getIpcServices()); + (isElectronRenderer() || + (typeof window !== 'undefined' && window.__LODY_LOCAL_BRIDGE__ === true)) && + Boolean(getIpcServices()); export type SendSessionFileLocalOutcome = | { ok: true; files: SessionFilePayload[]; message?: string }