From d863a9cf4ef4ff500e91b91c35b068867054bfc8 Mon Sep 17 00:00:00 2001 From: Adam <2363879+adamdotdevin@users.noreply.github.com> Date: Tue, 10 Feb 2026 12:28:54 -0600 Subject: [PATCH] fix(app): global event default fetch --- packages/app/src/context/global-sdk.tsx | 23 ----------------------- 1 file changed, 23 deletions(-) diff --git a/packages/app/src/context/global-sdk.tsx b/packages/app/src/context/global-sdk.tsx index e96d9c46f..af4bbdccc 100644 --- a/packages/app/src/context/global-sdk.tsx +++ b/packages/app/src/context/global-sdk.tsx @@ -15,32 +15,9 @@ export const { use: useGlobalSDK, provider: GlobalSDKProvider } = createSimpleCo // Prefer the WebView fetch implementation for streaming responses. // @tauri-apps/plugin-http 2.5.x has known issues with streaming/cancellation that can // retain native resources in the Rust process. - const base = platform.platform === "desktop" ? globalThis.fetch : (platform.fetch ?? globalThis.fetch) - - const eventFetch = Object.assign( - (input: Parameters[0], init?: Parameters[1]) => { - const password = (globalThis as { __OPENCODE__?: { serverPassword?: string } }).__OPENCODE__?.serverPassword - const header = password ? `Basic ${btoa(`opencode:${password}`)}` : undefined - - const headers = new Headers(input instanceof Request ? input.headers : undefined) - if (init?.headers) { - new Headers(init.headers).forEach((value, key) => { - headers.set(key, value) - }) - } - if (header) headers.set("Authorization", header) - - return base(input, { ...(init ?? {}), headers }) - }, - { - preconnect: (...args: Parameters) => (base as any).preconnect?.(...args), - }, - ) satisfies typeof fetch - const eventSdk = createOpencodeClient({ baseUrl: server.url, signal: abort.signal, - fetch: eventFetch, }) const emitter = createGlobalEmitter<{ [key: string]: Event