fix(opencode): move frontmatter parser out of plugins/ directory (#596)#600
Open
prayag0one4 wants to merge 1 commit into
Open
Conversation
There was a problem hiding this comment.
Pull request overview
Fixes OpenCode plugin-load failures caused by OpenCode’s legacy plugin loader mistakenly discovering and invoking parseCommandFile as a plugin when it lived under .opencode/plugins/.
Changes:
- Moved the frontmatter parser module out of
.opencode/plugins/so the legacy loader won’t discover it. - Updated the OpenCode plugin module to
require()the parser from its new location. - Updated tests to import the parser from the new path.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
tests/opencode-plugin.test.js |
Updates the direct require() path for parseCommandFile to match the parser’s new location. |
.opencode/ponytail-frontmatter.cjs |
Keeps the parser module outside .opencode/plugins/ and updates comments to reflect the loader behavior and incident. |
.opencode/plugins/ponytail.mjs |
Updates the relative require() path so the plugin uses the relocated parser module. |
…trichGebert#596) OpenCode's legacy plugin loader scans .opencode/plugins/ for modules and treats every exported function as a plugin. ponytail-frontmatter.cjs lived in that directory and exported parseCommandFile, which the loader invoked with the plugin context object as its first argument, passing { client: ... } to fs.readFileSync. This threw "path must be a string or a file descriptor" (DietrichGebert#301, DietrichGebert#596). Move the parser one level up to .opencode/ponytail-frontmatter.cjs, outside the scanned plugins/ directory. The plugins/ directory now contains only ponytail.mjs with its single default export.
prayag0one4
force-pushed
the
fix/opencode-frontmatter-plugin-scan-596
branch
from
July 16, 2026 01:24
b38a8d4 to
655f30c
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Loading the ponytail OpenCode plugin (
@dietrichgebert/ponytail, installed via"plugin": ["@dietrichgebert/ponytail"]) fails at plugin-load time with:Root Cause
ponytail-frontmatter.cjslived inside.opencode/plugins/, which OpenCode's legacy plugin loader scans for modules. It foundparseCommandFileexported from that file and tried to call it as a plugin, passing the plugin context object{ client: ... }as thefilePathargument tofs.readFileSync. This is a recurrence of #301 — the extraction worked forponytail.mjsexports but the file stayed in the scanned directory.Fix
Moved
ponytail-frontmatter.cjsfrom.opencode/plugins/to.opencode/(outside the scanned directory), updated the two require paths. Theplugins/directory now contains onlyponytail.mjswith its singledefaultexport.Verification
plugins/only contains the plugin function, nothing else to mistakenly invokepackage.jsonfilesfield uses.opencode/directory glob, so the moved file is still included in the npm packageCloses #596