fix(plugin): prevent compiled binary hang by removing lazy dynamic import (#1794)
Co-authored-by: opencode <noreply@opencode.ai>
This commit is contained in:
@@ -4,8 +4,7 @@ import { Config } from "../config/config"
|
|||||||
import { Bus } from "../bus"
|
import { Bus } from "../bus"
|
||||||
import { Log } from "../util/log"
|
import { Log } from "../util/log"
|
||||||
import { createOpencodeClient } from "@opencode-ai/sdk"
|
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"
|
import { BunProc } from "../bun"
|
||||||
|
|
||||||
export namespace Plugin {
|
export namespace Plugin {
|
||||||
@@ -14,7 +13,7 @@ export namespace Plugin {
|
|||||||
const state = App.state("plugin", async (app) => {
|
const state = App.state("plugin", async (app) => {
|
||||||
const client = createOpencodeClient({
|
const client = createOpencodeClient({
|
||||||
baseUrl: "http://localhost:4096",
|
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 config = await Config.get()
|
||||||
const hooks = []
|
const hooks = []
|
||||||
|
|||||||
Reference in New Issue
Block a user