fix(plugin): prevent compiled binary hang by removing lazy dynamic import (#1794)

Co-authored-by: opencode <noreply@opencode.ai>
This commit is contained in:
Tom
2025-08-11 08:31:15 +07:00
committed by GitHub
parent 95e410db88
commit 1c83ef75a2

View File

@@ -4,8 +4,7 @@ import { Config } from "../config/config"
import { Bus } from "../bus"
import { Log } from "../util/log"
import { createOpencodeClient } from "@opencode-ai/sdk"
// Lazy import to avoid circular dependency with session/tool registry
// import { Server } from "../server/server"
import { Server } from "../server/server"
import { BunProc } from "../bun"
export namespace Plugin {
@@ -14,7 +13,7 @@ export namespace Plugin {
const state = App.state("plugin", async (app) => {
const client = createOpencodeClient({
baseUrl: "http://localhost:4096",
fetch: async (...args) => (await import("../server/server")).Server.app().fetch(...args),
fetch: async (...args) => Server.app().fetch(...args),
})
const config = await Config.get()
const hooks = []