Skip to content

plugin: failed plugin state persists until serve restart, with no reload entrypoint #52061

Closed

Description

@MonNa-free

Summary

When a plugin fails to load (e.g. skill.transform schema failure), the failure state persists in the opencode serve --service process for its entire lifetime. Restarting the TUI does not retry the plugin, no API endpoint can trigger a reload, and the error message does not name the actual recovery step (restarting the background service). The plugin appears permanently broken even after the underlying cause is fixed.

Environment

  • opencode version: v2.0.19
  • OS: Linux 6.8.0-138-generic (Ubuntu 22.04, x86_64)
  • Terminal: xterm-256color, COLORTERM=truecolor
  • Shell: /bin/bash
  • Install/channel: latest
  • Active plugins: @mathew-cf/opencode-memory@2.1.0

Reproduction

  1. Configure a plugin whose state transform fails schema validation (ours produced SchemaError: Missing key at ["path"] during skill.transform).
  2. Start opencode; the server logs disabled plugin after transform failure with a ref.
  3. Fix the plugin file on disk while serve is still running.
  4. Close the TUI window and open a new one — the new CLI connects to the same serve --service process.
  5. GET /api/plugin still returns {"status":"failed","error":"Plugin disabled after skill.transform failed. Check server logs for details.","ref":"err_f96a8637"} — same ref as before, no retry happened.
  6. Attempt recovery via API:
    • POST /api/plugin/check → returns the plugin list, state unchanged
    • POST /api/plugin/update with valid targets → returns empty, state unchanged
    • POST /api/plugin/reload, /api/plugin/refresh, /api/plugin/enable → 404
  7. Kill the opencode serve --service process and reopen opencode → the plugin loads successfully.

Expected Behavior

One of:

  • Failed plugins are retried when the plugin file changes (the file watcher already watches plugin directories), or on new client connection/restart; or
  • A reload/retry entrypoint exists (POST /api/plugin/reload, or a retry action in the /plugins view); or
  • At minimum, the error message states the required recovery step (e.g. "restart the opencode background service") instead of only "Check server logs for details".

Actual Behavior

The failure state lives in serve-process memory until the process is killed. Closing and reopening the TUI has no effect, which presents as a permanently broken plugin. The visible error — Plugin disabled after skill.transform failed. Check server logs for details. — points to logs, but the logs don't name a recovery action either. Meanwhile GET /api/plugin reports status: failed with a stale ref from before the fix was applied.

Additional Context

  • Server log line:

    2026-09-29T08:49:21.608Z level=WARN message="disabled plugin after transform failure" plugin.id=opencode-memory state=skill ref=err_f96a8637 cause="Cause([Die(SchemaError(Missing key at [\"path\"]))])"
    
  • After the plugin source was corrected on disk, serve never re-attempted the load; only a full serve restart recovered it.

  • State persistence behavior is deterministic: any plugin that fails once stays failed until the serve process restarts.

  • Suggestion: surface failed plugins in the /plugins TUI view with a "retry" action, or add a POST /api/plugin/:id/retry endpoint.

Activity

  1. github-actions commented on Sep 29, 2026

    @github-actions
    Contributor

    This issue doesn't fully meet our contributing guidelines.

    What needs to be fixed:

    • Use the Bug Report template's required Description field. The issue currently has a Summary section instead; move or add the substantive bug description under Description. The report already includes useful reproduction and system details.

    Please edit this issue to address the above within 2 hours, or it will be automatically closed.


    This issue might be a duplicate of existing issues. Please check:

    • #46095: reports a plugin load failure that remains failed until the service restarts.
    • #44389 (closed): requests an explicit plugin reload route and describes failed plugin loads requiring a restart.

    If you believe this was flagged incorrectly, please let a maintainer know.

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

Metadata

Metadata

Assignees

Labels

needs:complianceThis means the issue will auto-close after 2 hours.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions