fix: preserve custom instructions (AGENTS.md) in CODEX mode #86
+146
−13
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.
Summary
Fixes #68 - The plugin was dropping custom instructions from
AGENTS.mdand other instruction files when using CODEX mode.Problem
In CODEX mode, the plugin filters out the entire OpenCode system prompt and replaces it with a Codex-compatible bridge message. However, OpenCode appends custom instruction files (like
AGENTS.md) directly into the system prompt. When the plugin filtered the prompt, it inadvertently dropped all custom instructions.Solution
Implemented the fix proposed in issue #68:
Instructions from:Changes
extractCustomInstructions()function to parse and extract instruction blocksfilterOpenCodeSystemPrompts()to return both filtered input and extracted custom instructionstransformRequestBody()to re-insert custom instructions after the bridge messageTesting
Impact
Users can now use custom instructions from
AGENTS.md, project-wide./AGENTS.md, and other instruction files with CODEX mode without losing their configurations.