Per-agent reminders and request settings for OpenCode v2, set in the agent's frontmatter.
Set chat_template_kwargs (like enable_thinking), sampling settings (temperature, top_p, top_k, min_p,
penalties) and a system reminder for each OpenCode agent. Works with llama.cpp, LiteLLM and other OpenAI-compatible
servers, and with thinking models like Qwen.
OpenCode v2 drops request settings such as temperature for OpenAI-compatible providers, and has no per-agent
reminder. agent-plus reads extra keys from the agent's .md file and applies them to every model request.
Tested with OpenCode 2.0.28 and llama.cpp behind LiteLLM.
Add it to the plugins list in opencode.json:
{
"plugins": ["github:Anooshiravan/opencode-agent-plus"]
}Or copy the src folder to ~/.config/opencode/plugins/agent-plus/.
---
description: Writing and editing text
mode: primary
model: litellm/my-model
temperature: 1.0
enable_thinking: false
reminder: |
- Keep replies short, simple words
- If unclear, say so — don't guess
---
You help the user write and edit text.| Key | Value | Effect |
|---|---|---|
reminder |
text, one line or a | block |
Added as the last message of every model request |
reminder_file |
path, relative to the agent's .md file |
Like reminder, read from a file |
temperature |
number | Request body |
top_p |
number | Request body |
top_k |
whole number | Request body |
min_p |
number | Request body |
presence_penalty |
number | Request body |
repeat_penalty |
number | Request body |
max_completion_tokens |
whole number | Request body |
reasoning_budget_tokens |
whole number | Request body (llama.cpp) |
reasoning_effort |
none, minimal, low, medium, high or xhigh |
Request body |
enable_thinking |
true or false |
Request body, under chat_template_kwargs |
Names are sent as written. A setting with a wrong value is not sent.
The system prompt sits at the start of the conversation. As the conversation grows with messages and tool output, the model pays less attention to that early text and drifts: longer answers, extra work, guessing. Models weigh recent text most, so a short reminder at the end puts the rules right where the model starts writing. Small local models benefit the most.
Before every model request, agent-plus adds one message at the end of the conversation with, in this order:
- the agent's
reminder - the agent's
reminder_file reminder.txtin the project folder, for every agent
The text is wrapped in <system-reminder> tags with a note that it is not from the user. Without this, the model may
take the reminder as your message and reply to it ("Understood. Short replies...") instead of answering you.
The message is only added to the outgoing request, NOT saved in the chat history. Every request has exactly one reminder at the end, so reminders never pile up.
The impact on the server's prompt cache (KV cache) is small and does not grow with the conversation:
- Request 1 is
history + reminder; the model writes its reply after the reminder. - Request 2 is
history + reply + new message + reminder.
The cache matches up to the end of history, where the old reminder was. The server then processes the model's last
reply again, plus the new message and the new reminder, which are new anyway. The extra cost per request is the length
of the last reply (one answer or one tool call), never the whole conversation. Servers that can reuse shifted cache
chunks, like llama.cpp with --cache-reuse, may recover part of it.
At start, a toast lists problems in agent files:
- misspelled keys, like
temprature → temperature - wrong values, like
top_k: must be a whole number - a
reminder_filethat is missing or empty
Unknown keys that don't look like a misspelling are left alone, so other plugins can add their own keys. With no problems, the toast says "agent-plus is loaded".
The session sidebar shows an "Agent-plus" section with the settings of the session's agent. It updates when you switch agents or save an agent file.
- Use
max_completion_tokens, notmax_tokens: OpenCode already sendsmax_completion_tokens, and servers use that one. - Do not give
reminder_filea.mdname: OpenCode loads every.mdin the agent folder as an agent. enable_thinkingandreasoning_budget_tokensneed a server that supports them, like llama.cpp.
MIT
