Skip to content

[BUG] Desktop v1.18.1: file:// plugin persists in UI after removal from all config sources #37099

Description

@mocun33

Bug Description

After removing a \ ile:///D:/plugins/bug-compaction.ts\ plugin from all known config sources and restarting OpenCode Desktop, the plugin still appears in the Desktop UI plugin list and generates \Failed to load plugin\ errors on every startup.

Environment

  • OpenCode Desktop: v1.18.1 (Electron) — Windows 11
  • opencode.jsonc: %USERPROFILE%\.config\opencode\opencode.jsonc\

Steps to Reproduce

  1. Add a local file plugin (via plugins/ auto-discovery or \ ile://\ specifier)
  2. Remove it from \opencode.jsonc:plugin\ array
  3. Delete the physical file
  4. Remove from \ ui.json, \plugins/\ directories, .opencode/\ directories (if present)
  5. Restart OpenCode Desktop
  6. Observe: plugin still appears in UI plugin list, \Failed to load plugin\ errors at startup

What Was Checked

All verified clean (no stale reference):

Location Status
\opencode.jsonc\ \plugin\ array ✅ Clean
\ ui.json\ ✅ Clean
~/.config/opencode/plugins/\ directory ✅ No file
.opencode/\ directory chain ✅ None exist
\plugin-meta.json\ ✅ Only oh-my-openagent
\opencode.global.dat\ (all 11 keys) ✅ No plugin field
18x \opencode.workspace.*.dat\ files ✅ No match
\opencode.db\ SQLite (19 tables) ✅ No plugin table
Physical file ✅ Deleted
Restart ✅ Bug persists

Root Cause (source code analysis)

In \packages/opencode/src/config/config.ts:

  • \plugin_origins\ is typed as derived state, not a persisted config field
  • \writable(info)\ strips \plugin_origins\ before serialization
  • \mergePluginOrigins()\ is append-only: calls \deduplicatePluginOrigins()\ but never removes entries absent from current config sources
  • \loadInstanceState()\ rebuilds \plugin_origins\ each startup by iterating config sources

The Desktop v2 migration (v1.18.0) may retain a stale \plugin_origins\ snapshot that re-enters the merge chain.

Related Issues

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions