fix(instance): restore InstanceBootstrap init parameter for non-Effec… (#25449)

Co-authored-by: Dax Raad <d@ironbay.co>
This commit is contained in:
HyeokjaeLee
2026-05-03 04:26:30 +09:00
committed by GitHub
parent 05b82a6a30
commit 430bde9e9b
6 changed files with 26 additions and 6 deletions

View File

@@ -1,9 +1,11 @@
import { Instance } from "../project/instance"
import { InstanceStore } from "../project/instance-store"
import { getBootstrapRunEffect } from "../effect/app-runtime"
export async function bootstrap<T>(directory: string, cb: () => Promise<T>) {
return Instance.provide({
directory,
init: await getBootstrapRunEffect(),
fn: async () => {
try {
const result = await cb()

View File

@@ -10,7 +10,7 @@ import { GlobalBus } from "@/bus/global"
import { Flag } from "@opencode-ai/core/flag/flag"
import { writeHeapSnapshot } from "node:v8"
import { Heap } from "@/cli/heap"
import { AppRuntime } from "@/effect/app-runtime"
import { AppRuntime, getBootstrapRunEffect } from "@/effect/app-runtime"
import { ensureProcessMetadata } from "@opencode-ai/core/util/opencode-process"
ensureProcessMetadata("worker")
@@ -77,6 +77,7 @@ export const rpc = {
async checkUpgrade(input: { directory: string }) {
await Instance.provide({
directory: input.directory,
init: await getBootstrapRunEffect(),
fn: async () => {
await upgrade().catch(() => {})
},