refactor(opencode): improve startup time by 38% (#30453)

Co-authored-by: starptech <starptech@starptechs-MBP.fritz.box>
This commit is contained in:
Dustin Deus
2026-06-02 21:20:25 +02:00
committed by GitHub
co-authored by starptech
parent 83c12f334e
commit 7dd2306dad
20 changed files with 1878 additions and 1851 deletions
+1 -1
View File
@@ -1,5 +1,4 @@
import { Effect } from "effect"
import { Server } from "../../server/server"
import { effectCmd } from "../effect-cmd"
import { withNetworkOptions, resolveNetworkOptions } from "../network"
import { Flag } from "@opencode-ai/core/flag/flag"
@@ -12,6 +11,7 @@ export const ServeCommand = effectCmd({
// need for an ambient project InstanceContext at startup.
instance: false,
handler: Effect.fn("Cli.serve")(function* (args) {
const { Server } = yield* Effect.promise(() => import("../../server/server"))
if (!Flag.OPENCODE_SERVER_PASSWORD) {
console.log("Warning: OPENCODE_SERVER_PASSWORD is not set; server is unsecured.")
}