From 88363f1ed9a4bd8b4dd2c8590f175c7e5ed3a802 Mon Sep 17 00:00:00 2001 From: Dax Raad Date: Sat, 16 May 2026 08:27:25 -0400 Subject: [PATCH] fixed issue in opencode run --- packages/opencode/src/cli/cmd/run.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/opencode/src/cli/cmd/run.ts b/packages/opencode/src/cli/cmd/run.ts index 9487d6d826..4c8c97d53a 100644 --- a/packages/opencode/src/cli/cmd/run.ts +++ b/packages/opencode/src/cli/cmd/run.ts @@ -24,6 +24,7 @@ import { createOpencodeClient, type OpencodeClient, type ToolPart } from "@openc import { Agent } from "@/agent/agent" import { Permission } from "@/permission" import { RuntimeFlags } from "@/effect/runtime-flags" +import { InstanceRef } from "@/effect/instance-ref" import { FormatError, FormatUnknownError } from "../error" import { INTERACTIVE_INPUT_ERROR, resolveInteractiveStdin } from "./run/runtime.stdin" @@ -236,6 +237,7 @@ export const RunCommand = effectCmd({ handler: Effect.fn("Cli.run")(function* (args) { const agentSvc = yield* Agent.Service const flags = yield* RuntimeFlags.Service + const localInstance = yield* InstanceRef yield* Effect.promise(async () => { const rawMessage = [...args.message, ...(args["--"] || [])].join(" ") const thinking = args.interactive ? (args.thinking ?? true) : (args.thinking ?? false) @@ -508,7 +510,9 @@ export const RunCommand = effectCmd({ if (!args.agent) return undefined const name = args.agent - const entry = await Effect.runPromise(agentSvc.get(name)) + const entry = await Effect.runPromise( + agentSvc.get(name).pipe(Effect.provideService(InstanceRef, localInstance)), + ) if (!entry) { UI.println( UI.Style.TEXT_WARNING_BOLD + "!",