From b2eae867a16e759dd23552a334fda14bbf667dcc Mon Sep 17 00:00:00 2001 From: Dax Raad Date: Tue, 10 Mar 2026 01:18:34 -0400 Subject: [PATCH] tui: fix Windows plugin loading by using direct paths instead of file URLs --- packages/opencode/src/tool/registry.ts | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/packages/opencode/src/tool/registry.ts b/packages/opencode/src/tool/registry.ts index 467bca4fd4..25bbf14e10 100644 --- a/packages/opencode/src/tool/registry.ts +++ b/packages/opencode/src/tool/registry.ts @@ -30,7 +30,6 @@ import { Truncate } from "./truncation" import { ApplyPatchTool } from "./apply_patch" import { Glob } from "../util/glob" import { pathToFileURL } from "url" -import { createRequire } from "module" export namespace ToolRegistry { const log = Log.create({ service: "tool.registry" }) @@ -46,9 +45,7 @@ export namespace ToolRegistry { if (matches.length) await Config.waitForDependencies() for (const match of matches) { const namespace = path.basename(match, path.extname(match)) - const require = createRequire(match) - const resolved = require.resolve(match) - const mod = await import(pathToFileURL(resolved).href) + const mod = await import(process.platform === "win32" ? match : pathToFileURL(match).href) for (const [id, def] of Object.entries(mod)) { custom.push(fromPlugin(id === "default" ? namespace : `${namespace}_${id}`, def)) }