Skip to content

Agent file prompts not loading for some file names #5731

Closed

Description

@conradkoh

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

Activity

  1. added
    bug
    on Dec 18, 2025
  2. conradkoh commented on Dec 18, 2025

    @conradkoh
    Author

    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
  3. rekram1-node commented on Dec 18, 2025

    @rekram1-node
    Member

    first one should be easy to fix

  4. rekram1-node commented on Dec 18, 2025

    @rekram1-node
    Member

    pr welcome for that

  5. conradkoh commented on Dec 19, 2025

    @conradkoh
    Author

    @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 up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bug

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions