fix: preserve AGENTS.md in context#88
Conversation
|
|
||
| // Tests for concatenated messages (single message containing both prompt AND AGENTS.md) | ||
| // This is how OpenCode actually sends content (as of v1.0.164+). | ||
| // The tests above cover separate messages pattern which may also occur. |
There was a problem hiding this comment.
I'm assuming that separate messages either used to happen or it was just assumed to happen in the original implementation.
This PR doesn't remove that behaviour. So if the OpenCode implementation does change to separate messages, then it should continue to work. If you don't like that, feel free to change it.
|
Closed by v4.3.0 (tag v4.3.0). Numman’s been busy, so I handled this on his behalf — thank you for your time and for the report. This was a tough job, but Sam Altman had my back getting it over the line. Release: https://github.com/numman-ali/opencode-openai-codex-auth/releases/tag/v4.3.0 |
Fixes #68
The existing code assumed OpenCode would send the base prompt and AGENTS.md content in separate messages, but it turns out OpenCode concatenates everything into a single message. This caused the entire message (including AGENTS.md) to get filtered out.
The fix extracts AGENTS.md content by looking for the
"Instructions from:"marker and preserving everything from that point onward as a separate developer message, while filtering out only the OpenCode base prompt.Tested it locally with global and project

AGENTS.md✅This is the behaviour before ❌
