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
- Add a local file plugin (via plugins/ auto-discovery or \ile://\ specifier)
- Remove it from \opencode.jsonc:plugin\ array
- Delete the physical file
- Remove from \ ui.json, \plugins/\ directories, .opencode/\ directories (if present)
- Restart OpenCode Desktop
- 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
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
Steps to Reproduce
What Was Checked
All verified clean (no stale reference):
Root Cause (source code analysis)
In \packages/opencode/src/config/config.ts:
The Desktop v2 migration (v1.18.0) may retain a stale \plugin_origins\ snapshot that re-enters the merge chain.
Related Issues
pluginarray silently not loaded since v1.17.0 #33455 — v1.17.0+ plugins silently not loaded