|
|
@@ -40,6 +40,7 @@ import { CrossSpawnSpawner } from "@opencode-ai/core/cross-spawn-spawner"
|
|
|
import { Ripgrep } from "../file/ripgrep"
|
|
|
import { Format } from "../format"
|
|
|
import { InstanceState } from "@/effect/instance-state"
|
|
|
+import { EffectBridge } from "@/effect/bridge"
|
|
|
import { Question } from "../question"
|
|
|
import { Todo } from "../session/todo"
|
|
|
import { LSP } from "@/lsp/lsp"
|
|
|
@@ -158,9 +159,12 @@ export const layer: Layer.Layer<
|
|
|
description: def.description,
|
|
|
execute: (args, toolCtx) =>
|
|
|
Effect.gen(function* () {
|
|
|
+ // Bridge the host's Effect-based `ask` into a Promise-returning
|
|
|
+ // function for the plugin to make sure context persists
|
|
|
+ const bridge = yield* EffectBridge.make()
|
|
|
const pluginCtx: PluginToolContext = {
|
|
|
...toolCtx,
|
|
|
- ask: (req) => toolCtx.ask(req),
|
|
|
+ ask: (req) => bridge.promise(toolCtx.ask(req)),
|
|
|
directory: ctx.directory,
|
|
|
worktree: ctx.worktree,
|
|
|
}
|