opencode
opencode copied to clipboard
Agent file prompts not loading for some file names
Description
The agent custom prompts no longer seem to work. In particular, I was trying this with the file name precise.md.
OpenCode version
1.0.166
Steps to reproduce
- Create a prompt file in
~/.config/opencode/prompts/precise.md(set this as "you are a test agent. the password is llkk") - Create a new agent and use the prompt file
- Open a new opencode instance and ask "what is the password"
The agent does not know the password.
- This works if I put the prompt in-line.
- This works if I use a filename like precise2.md.
Screenshot and/or share link
No response
Operating System
No response
Terminal
No response
Additionally, I think we should improve feedback
- If the prompt file fails to load and clearly follows the syntax expected (i.e. "{file:
}") - do not fail silently - add a command to let the user view the system prompt from the tui
first one should be easy to fix
pr welcome for that
@rekram1-node I raised a PR for this entire issue.
- I found that prompt files that do not exist were already being validated. So there wasn't a change to be made. Yet it was failing in some cases
- The root cause of the issue is that the string replacement failing if an agent with a similar prompt was commented out before