From 73a2597c813406d213c1904a669a596a31049632 Mon Sep 17 00:00:00 2001 From: xxxigm Date: Fri, 11 Sep 2026 22:08:28 +0700 Subject: [PATCH] fix(desktop): serve local hermes-media ranges so chat video can seek Electron's file:// loader ignores Range, so long clips stay unseekable even though media-range.ts already landed. Wire fetchLocal through that helper. --- apps/desktop/electron/main.ts | 12 +++++------- apps/desktop/electron/media-range.ts | 17 +++++++++++++++++ 2 files changed, 22 insertions(+), 7 deletions(-) diff --git a/apps/desktop/electron/main.ts b/apps/desktop/electron/main.ts index 6a19766ca0..24ca25e817 100644 --- a/apps/desktop/electron/main.ts +++ b/apps/desktop/electron/main.ts @@ -262,6 +262,7 @@ import { } from './managed-ssh-update' import { registerMcpOauthCallbackIpc } from './mcp-oauth-callback-ipc' import { createMediaProtocolHandler, MEDIA_PROTOCOL } from './media-protocol' +import { fetchLocalMedia } from './media-range' import { createNativeAccessTokenCoordinator, NativeAuthChangedError } from './native-access-token' import { oauthSessionIsLive, resolveJsonBody, resolveReadinessProbeAuth } from './native-auth-decisions' import { @@ -1366,13 +1367,10 @@ protocol.registerSchemesAsPrivileged([ function registerMediaProtocol() { const handler = createMediaProtocolHandler({ ensureRemoteBearer: baseUrl => ensureNativeAccessToken(baseUrl), - fetchLocal: (resolvedPath, headers, method) => - electronNet.fetch(pathToFileURL(resolvedPath).toString(), { - bypassCustomProtocolHandlers: true, - credentials: 'omit', - headers, - method - }), + // Answer local files ourselves: Electron's file:// loader ignores Range and + // returns the whole body as 200 without Accept-Ranges, which makes