Bug Description
On Windows, plugin paths are displayed incorrectly in the UI. Instead of showing the plugin name (e.g., oh-my-opencode), the full filesystem path is shown (e.g., C:\Users\Username\ or E:\opencode\).
Root Cause
In packages/opencode/src/config/config.ts line 1250:
data.plugin[i] = import.meta.resolve!(plugin, options.path)
On Windows, import.meta.resolve() returns a raw filesystem path like E:\path\to\plugin\index.js instead of a file:// URL. This causes:
getPluginName() fails to extract the plugin name (it checks for file:// prefix)
- The raw path is displayed directly in the UI
Note: The fallback require.resolve() path correctly uses pathToFileURL() on line 1256.
Expected Behavior
Plugin list should show plugin names like oh-my-opencode @latest.
Actual Behavior
Plugin list shows raw paths like C:\Users\Username\ or E:\opencode\.
Environment
- Windows 10/11
- OpenCode v1.2.21
Suggested Fix
Convert the resolved path to a file:// URL consistently:
const resolved = import.meta.resolve!(plugin, options.path)
data.plugin[i] = resolved.startsWith("file://") ? resolved : pathToFileURL(resolved).href
Bug Description
On Windows, plugin paths are displayed incorrectly in the UI. Instead of showing the plugin name (e.g.,
oh-my-opencode), the full filesystem path is shown (e.g.,C:\Users\Username\orE:\opencode\).Root Cause
In
packages/opencode/src/config/config.tsline 1250:On Windows,
import.meta.resolve()returns a raw filesystem path likeE:\path\to\plugin\index.jsinstead of afile://URL. This causes:getPluginName()fails to extract the plugin name (it checks forfile://prefix)Note: The fallback
require.resolve()path correctly usespathToFileURL()on line 1256.Expected Behavior
Plugin list should show plugin names like
oh-my-opencode @latest.Actual Behavior
Plugin list shows raw paths like
C:\Users\Username\orE:\opencode\.Environment
Suggested Fix
Convert the resolved path to a
file://URL consistently: