Agent file prompts not loading for some file names #3637

Open
opened 2026-02-16 17:40:58 -05:00 by yindo · 4 comments
Owner

Originally created by @conradkoh on GitHub (Dec 18, 2025).

Originally assigned to: @rekram1-node on GitHub.

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

  1. Create a prompt file in ~/.config/opencode/prompts/precise.md (set this as "you are a test agent. the password is llkk")
  2. Create a new agent and use the prompt file
  3. 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

Originally created by @conradkoh on GitHub (Dec 18, 2025). Originally assigned to: @rekram1-node on GitHub. ### 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 1. Create a prompt file in `~/.config/opencode/prompts/precise.md` (set this as "you are a test agent. the password is llkk") 2. Create a new agent and use the prompt file 3. 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_
yindo added the bug label 2026-02-16 17:40:58 -05:00
Author
Owner

@conradkoh commented on GitHub (Dec 18, 2025):

Additionally, I think we should improve feedback

  1. If the prompt file fails to load and clearly follows the syntax expected (i.e. "{file:}") - do not fail silently
  2. add a command to let the user view the system prompt from the tui
@conradkoh commented on GitHub (Dec 18, 2025): Additionally, I think we should improve feedback 1. If the prompt file fails to load and clearly follows the syntax expected (i.e. "{file:<path>}") - do not fail silently 2. add a command to let the user view the system prompt from the tui
Author
Owner

@rekram1-node commented on GitHub (Dec 18, 2025):

first one should be easy to fix

@rekram1-node commented on GitHub (Dec 18, 2025): first one should be easy to fix
Author
Owner

@rekram1-node commented on GitHub (Dec 18, 2025):

pr welcome for that

@rekram1-node commented on GitHub (Dec 18, 2025): pr welcome for that
Author
Owner

@conradkoh commented on GitHub (Dec 18, 2025):

@rekram1-node I raised a PR for this entire issue.

  1. 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
  2. The root cause of the issue is that the string replacement failing if an agent with a similar prompt was commented out before
@conradkoh commented on GitHub (Dec 18, 2025): @rekram1-node I raised a PR for this entire issue. 1. 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 2. The root cause of the issue is that the string replacement failing if an agent with a similar prompt was commented out before
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#3637