From 553f9ebfe70d93bfc40fc26819020acfbc315d80 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Haris=20Gu=C5=A1i=C4=87?= Date: Fri, 31 Oct 2025 23:35:15 +0100 Subject: [PATCH] opentui: fix: Make worker.ts path independent from cwd (#3600) --- packages/opencode/src/cli/cmd/tui/thread.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/opencode/src/cli/cmd/tui/thread.ts b/packages/opencode/src/cli/cmd/tui/thread.ts index cadeac17e..08b1d0601 100644 --- a/packages/opencode/src/cli/cmd/tui/thread.ts +++ b/packages/opencode/src/cli/cmd/tui/thread.ts @@ -6,6 +6,7 @@ import { upgrade } from "@/cli/upgrade" import { Session } from "@/session" import { bootstrap } from "@/cli/bootstrap" import path from "path" +import { fileURLToPath } from "url" import { UI } from "@/cli/ui" export const TuiThreadCommand = cmd({ @@ -78,7 +79,9 @@ export const TuiThreadCommand = cmd({ return undefined })() - const worker = new Worker("./src/cli/cmd/tui/worker.ts") + const worker = new Worker( + path.join(path.dirname(fileURLToPath(import.meta.url)), "worker.ts"), + ) worker.onerror = console.error const client = Rpc.client(worker) process.on("uncaughtException", (e) => {