Skip to content

aft-opencode plugin fails to load on opencode v2 (SchemaError: Expected object, got async initializer) #212

Description

@ftzi

Environment

  • opencode v2 (opencode2, v0.0.0-next-17395 — the current V2 line)
  • plugin: @cortexkit/aft-opencode@0.49.4 declared in the user-level config ("plugin": ["@cortexkit/aft-opencode@latest"] in ~/.config/opencode/opencode.jsonc)
  • On V1 (opencode 1.18.15) the same entry loads fine

Error (server log, every session start):

failed to load plugin target=@cortexkit/aft-opencode@latest
cause=Cause([Fail(SchemaError(Expected object, got async (input) => initializePluginForDirectory(input)
  at ["default"]))])

Analysis
The plugin's dist exports the V1-style async initializePlugin function as the default export. The V2 plugin loader requires the module's default export to be a plain object (the V2 plugin contract). The plugin therefore never loads on V2 — it is npm-installed on demand, rejected with the SchemaError, and retried on every server start.

Request
Ship a V2-compatible build (default export object per the V2 plugin API), or document the V1-only status and the exact incompatibility. Happy to test a fix.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions