Repository navigation
Description
Bug Report
Version: v1.14.32 (regression from v1.14.31)
Component: Plugin System / Instance Bootstrap
Severity: High — all third-party plugins that register agents/MCPs are broken
Summary
After upgrading from v1.14.31 to v1.14.32, third-party plugins (e.g., oh-my-opencode) load successfully (green indicator in UI) but their custom agents and MCP servers silently fail to register. Only the default build and plan agents appear. Plugin-provided MCP servers show up in the UI but are greyed out / disabled with no toggle to enable them.
Reverting to v1.14.31 immediately restores all plugin agents and MCPs.
Root Cause
The InstanceStore refactor in v1.14.32 broke AsyncLocalStorage (ALS) propagation during plugin initialization.
v1.14.31 (working)
Instance.provide() -> boot() sets ALS before running init:
typescript // packages/opencode/src/project/instance.ts @ v1.14.31 function boot(input: { directory: string; init?: () => Promise<any>; ... }) { return iife(async () => { const ctx = /* resolve context */ await context.provide(ctx, async () => { // ALS IS SET HERE await input.init?.() // plugin init runs WITH ALS available }) return ctx }) }
v1.14.32 (broken)
InstanceStore.boot() only provides InstanceRef via Effect context, not ALS:
typescript // packages/opencode/src/project/instance-store.ts @ v1.14.32 (lines 62-68) const boot = <R>(input: LoadInput<R> & { directory: string }) => Effect.gen(function* () { const ctx: InstanceContext = /* resolve context */ if (input.init) yield* input.init.pipe(Effect.provideService(InstanceRef, ctx)) // Only Effect Context, NO ALS return ctx })
Why it breaks
- Plugin
init()runs as an async callback insideEffect.promise() InstanceRef(Effect Context) does NOT propagate across async/await boundaries — only Node.js ALS does- When the plugin's async server function calls
Instance.current(which uses ALS), it throwsLocalContext.NotFound - Agent and MCP registration silently fails — no error is surfaced to the user
The fix pattern already exists
The v1.14.32 codebase itself documents this exact limitation in packages/opencode/src/effect/bridge.ts:
"Effect's
InstanceRef/WorkspaceRefdo not propagate across async/await boundaries insideEffect.promise(() => async fn)callbacks that re-enter Effect viaAppRuntime.runPromise, but Node's AsyncLocalStorage does. Use this whenever an Effect crosses into JS that may itself spawn new Effect runtimes (workspace adapters, legacy plugins, etc.)."
The EffectBridge.fromPromise function was added to solve this for workspace adapters, but the same pattern was not applied to the plugin initialization path in InstanceStore.boot.
Reproduction Steps
- Install
oh-my-opencodeplugin (or any plugin that registers custom agents viaoh-my-openagent.jsonc) - Configure agents in
oh-my-openagent.jsonc - Upgrade OpenCode from v1.14.31 to v1.14.32
- Restart OpenCode
- Observe: only
buildandplanagents appear; plugin MCPs are greyed out
Suggested Fix
Apply the same ALS restoration pattern from EffectBridge.fromPromise to InstanceStore.boot:
``typescript
// Current (broken):
if (input.init)
yield* input.init.pipe(Effect.provideService(InstanceRef, ctx))
// Fix: Also restore ALS so async callbacks inside init can access Instance.current
if (input.init) {
const { context: instanceContext } = await import("./instance-context")
yield* Effect.promise(() =>
instanceContext.provide(ctx, async () => {
await Effect.runPromise(input.init!.pipe(Effect.provideService(InstanceRef, ctx)))
})
)
}
``
Environment
- OS: Windows 11
- OpenCode: v1.14.32 (Desktop + CLI)
- Plugin: oh-my-opencode@3.17.12
- Node: v24.11.0
Related Files
| File | Change |
|---|---|
packages/opencode/src/project/instance-store.ts |
New file — boot() provides InstanceRef but not ALS |
packages/opencode/src/project/instance.ts |
Refactored — delegates to InstanceStore.load |
packages/opencode/src/project/bootstrap.ts |
Refactored from Effect.gen to Service class |
packages/opencode/src/effect/bridge.ts |
Added fromPromise — the fix pattern that should be applied to InstanceStore.boot |
packages/opencode/src/plugin/index.ts |
WorkspaceAdaptor -> WorkspaceAdapter rename |
Activity
github-actions commentedon May 2, 2026
This issue might be a duplicate of existing issues. Please check:
gabriel-ferraresi commentedon May 2, 2026
Related: #21032 — This is the same class of bug that occurred in v1.3.14. The pattern repeats: OpenCode refactors the instance bootstrap, ALS context propagation breaks, and plugins silently fail to register agents/MCPs. The root cause is the same — plugin async callbacks lose \Instance.current\ (ALS) across Effect/async boundaries. Our issue provides the exact code-level diagnosis and a suggested fix for the v1.14.32 occurrence.
thdxr commentedon May 2, 2026
tested a few plugins and they seem to work, checking what's going on with omo specifically
gabriel-ferraresi commentedon May 2, 2026
Confirmed fixed in v1.14.33 via PR #25449. The fix restores the init parameter (getBootstrapRunEffect()) in all 5 entry points (CLI bootstrap, TUI worker, Hono middleware, workspace router, project reload) plus adds defense-in-depth in the Agent state builder. Plugin agents and MCPs now register correctly after upgrading to v1.14.33. Closing.