Skip to content

v2: deferred plugin transform failure leaves readiness latch closed and bricks catalog #44920

Closed

Description

@pascalandr

Problem

Direct failures from a plugin's setup/effect are isolated by Plugin.load(...).pipe(Effect.exit). A transform failure is not isolated when State.batch defers its materialization until after that boundary:

  1. setup registers a transform while Plugin.activate is batched.
  2. The callback is stored without being invoked, so the plugin is marked active.
  3. State.batch later materializes the transform and it throws.
  4. The defect escapes into PluginSupervisor.activate.

The supervisor catches it before opening readiness:

yield* activate()
if (observed === target) yield* ready.open
.pipe(Effect.catchCause((cause) => Effect.logError("failed to reload plugins", { cause })))

The latch therefore remains closed and PluginSupervisor.flush never completes.

This is narrower than a direct setup throw or a PluginModule decode failure; both are already isolated.

Repro

export default {
  id: "broken-transform",
  async setup(ctx) {
    await ctx.command.transform(() => {
      throw new Error("broken deferred transform")
    })
  },
}

The observed plugin used the obsolete commands.update() API. That plugin is invalid, but its transform failure should not block unrelated startup.

ERROR failed to reload plugins
      TypeError: commands.update is not a function
ERROR Model catalog initialization timed out  service=model.catalog

Impact

model.list times out waiting for plugin readiness. TUI location sync then rejects as a whole and displays Session location unavailable for an existing directory, with empty catalog pickers. Direct provider API requests still succeed.

Expected

  • Attribute the transform failure to its plugin and remove the failed registration.
  • Mark the plugin failed rather than active.
  • Settle readiness so healthy plugins, catalog reads, and location startup continue.
  • Do not present this service error as a missing directory.

Environment

  • OpenCode: 0.0.0-beta-18155 (d6deb62379)
  • OS: Windows 11

Related: #35963, #42878, #36117.

Activity

  1. changed the title [-]v2: V1 plugins in shared config brick catalog and show Session location unavailable[/-] [+]v2: plugin setup throw bricks catalog and shows Session location unavailable[/+] on Aug 25, 2026
  2. changed the title [-]v2: plugin setup throw bricks catalog and shows Session location unavailable[/-] [+]v2: deferred plugin transform failure leaves readiness latch closed and bricks catalog[/+] on Aug 25, 2026
  3. neriousy commented on Oct 20, 2026

    @neriousy
    Member

    This was fixed in v2.0.0 by #47083: a deferred transform failure disables the responsible plugin, removes its registrations, and lets healthy plugins continue. Readiness is released after recovery rather than leaving catalog initialization blocked. If you still see this on v2, please open a new issue with the details.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions