You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Sep 18, 2025. It is now read-only.
Repository navigation
This repository was archived by the owner on Sep 18, 2025. It is now read-only.
Doesn't follow some instructions in opencode.md #90
Does it follow the other instructions? I am wondering if OpenCode is loading the file or not. Also if that does not work maybe try to change the message to be more specific, usually claude does a good job following these kind of instructions
Feel free to close and I can try again after #86 is in. If it still doesn't work I'll learn more about debugging in go and try to figure it out. Thanks!
I think the issue is that it has not a lot to do with OpenCode directly, the LLM is just choosing not to care about that rule. Its more prompt engineering than go, I think if we make sure to tell the LLM that "hey you need to follow these rules" it will do it.
I've been avoiding diving into too much golang so far so tried a couple other things first:
Verified with logging that the contents of opencode.md are being sent to sonnet
Renaming it to CLAUDE.md and running the same prompt ("what is fast-agent?") triggers the tool
Based on 2 I'll do some more poking next to see what's different between the two. I have a hunch that it could be related to the ordering of the prompt(s) content.
@possibilities we just merged #86 that explicitly tells the LLM to follow instructions in the context files, try it out again and let me know if it is better
I tried rewriting the details about Context7 a number of different ways including adding the full documentation :
- `resolve-library-id`: Resolves a general library name into a Context7-compatible library ID.
- `libraryName` (required)
- `get-library-docs`: Fetches documentation for a library using a Context7-compatible library ID.
- `context7CompatibleLibraryID` (required)
- `topic` (optional): Focus the docs on a specific topic (e.g., "routing", "hooks")
- `tokens` (optional, default 5000): Max number of tokens to return. Values less than 5000 are automatically increased to 5000.
But the only way the tool is ever used is when:
The instructions are the only contents in opencode.md
The instructions are pasted directly into opencode before any prompt
With claude code it picks up on the instruction if it's somewhere in CLAUDE.md.
In my opinion it's not behaving "correctly" but I think only you, as the author, can decide what's expected. Should I be able to guide tool use in opencode.md?
Can you suggest a way of phrasing it that should trigger the tool to be used?
BTW, I test this by opening a project and asking opencode "what's fast-agent?" with the context7 MCP installed.
I am wondering if fast-agent is just too generic, what if you say something what is the library fast-agent or something to tell it that your are talking about a library.
Also maybe add something along the lines
If you don't know exactly what I am talking about always use context7 to retrieve information
The test works well if there are only 1-5 lines in opencode.md (using your instruction or mine) but as soon as there are greater than 10 lines it is ignored.
To me it seems like it should work but I don't want to distract you with this problem if it's unique to me. If it's an actual problem and not unique to me you will get other reports in the future.
I appreciate all your attention on this but all for closing it if you are.
Activity
kujtimiihoxha commentedon Apr 27, 2025
Does it follow the other instructions? I am wondering if OpenCode is loading the file or not. Also if that does not work maybe try to change the message to be more specific, usually claude does a good job following these kind of instructions
possibilities commentedon Apr 27, 2025
It works if it's the only line in opencode.md but when I put all the rules I want (32 lines total) it no longer works.
possibilities commentedon Apr 27, 2025
Feel free to close and I can try again after #86 is in. If it still doesn't work I'll learn more about debugging in go and try to figure it out. Thanks!
kujtimiihoxha commentedon Apr 27, 2025
I think the issue is that it has not a lot to do with OpenCode directly, the LLM is just choosing not to care about that rule. Its more prompt engineering than go, I think if we make sure to tell the LLM that "hey you need to follow these rules" it will do it.
possibilities commentedon Apr 27, 2025
I've been avoiding diving into too much golang so far so tried a couple other things first:
Based on 2 I'll do some more poking next to see what's different between the two. I have a hunch that it could be related to the ordering of the prompt(s) content.
kujtimiihoxha commentedon Apr 27, 2025
@possibilities we just merged #86 that explicitly tells the LLM to follow instructions in the context files, try it out again and let me know if it is better
possibilities commentedon Apr 27, 2025
#86 (comment)
possibilities commentedon Apr 28, 2025
Still have the same issues with the latest.
I tried rewriting the details about Context7 a number of different ways including adding the full documentation :
But the only way the tool is ever used is when:
With claude code it picks up on the instruction if it's somewhere in CLAUDE.md.
In my opinion it's not behaving "correctly" but I think only you, as the author, can decide what's expected. Should I be able to guide tool use in opencode.md?
Can you suggest a way of phrasing it that should trigger the tool to be used?
BTW, I test this by opening a project and asking opencode "what's fast-agent?" with the context7 MCP installed.
kujtimiihoxha commentedon Apr 28, 2025
How does your config look like? Did you add the mcp to opencode?
possibilities commentedon Apr 28, 2025
kujtimiihoxha commentedon Apr 28, 2025
I am wondering if fast-agent is just too generic, what if you say something what is the library fast-agent or something to tell it that your are talking about a library.
Also maybe add something along the lines
Just a thought🤔
possibilities commentedon Apr 28, 2025
The test works well if there are only 1-5 lines in opencode.md (using your instruction or mine) but as soon as there are greater than 10 lines it is ignored.
To me it seems like it should work but I don't want to distract you with this problem if it's unique to me. If it's an actual problem and not unique to me you will get other reports in the future.
I appreciate all your attention on this but all for closing it if you are.
kujtimiihoxha commentedon Apr 28, 2025
Thanks @possibilities, we can circle back to this again when i look into improving the prompts in general it is on my list