Bug
opencode v1's plugin loader has a getLegacyPlugins() function that iterates all exported values from a plugin module and treats every function as a plugin factory. When parseCommandFile is a named export, the loader calls it with a PluginInput object — but parseCommandFile expects a file path string and calls fs.readFileSync(PluginInput, 'utf8'), which throws:
ERROR failed to load plugin path=@dietrichgebert/ponytail error="path must be a string or a file descriptor"
Fix
Remove the export keyword from parseCommandFile in .opencode/plugins/ponytail.mjs — it's only used internally and shouldn't be a named export.
- export function parseCommandFile(filePath) {
+ function parseCommandFile(filePath) {
Impact
Plugin fails to load on opencode v1.18.4 (and likely any v1.x using getLegacyPlugins). The error is silent to the user (no UI notification), only visible in server logs with --log-level DEBUG.
Bug
opencode v1's plugin loader has a
getLegacyPlugins()function that iterates all exported values from a plugin module and treats every function as a plugin factory. WhenparseCommandFileis a named export, the loader calls it with aPluginInputobject — butparseCommandFileexpects a file path string and callsfs.readFileSync(PluginInput, 'utf8'), which throws:Fix
Remove the
exportkeyword fromparseCommandFilein.opencode/plugins/ponytail.mjs— it's only used internally and shouldn't be a named export.Impact
Plugin fails to load on opencode v1.18.4 (and likely any v1.x using
getLegacyPlugins). The error is silent to the user (no UI notification), only visible in server logs with--log-level DEBUG.