Skip to content

The open source coding agent.

TypeScript

core: fix plugin hooks to properly handle async operations ensuring plugins can execute async code without errors (#19586)

Aiden Cline55895d066367
diff --git a/packages/opencode/src/plugin/index.ts b/packages/opencode/src/plugin/index.ts
index 9698487f915..a945b4b98af 100644
--- a/packages/opencode/src/plugin/index.ts
+++ b/packages/opencode/src/plugin/index.ts
@@ -292,7 +292,7 @@ export namespace Plugin {
for (const hook of state.hooks) {
const fn = hook[name] as any
if (!fn) continue
- yield* Effect.promise(() => fn(input, output))
+ yield* Effect.promise(async () => fn(input, output))
}
return output
})