[PR #12144] feat: add specific system prompt for Trinity model #14085

Closed
opened 2026-02-16 18:18:54 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/anomalyco/opencode/pull/12144

State: closed
Merged: Yes


What does this PR do?

Adds system prompt support for Trinity models (e.g. via OpenRouter). When the model id contains "trinity", we use a dedicated prompt that: uses exactly one tool per message, waits for the result before continuing, uses the question tool when the request is vague, and avoids repeating the same tool with the same params. The prompt is a small change on top of the default: same content except the “Tool usage policy” and “Doing tasks” sections are replaced with these Trinity rules. Routing is a single check in SystemPrompt.provider() in system.ts before the default branch.

Closes #12146

How did you verify your code works?

Added a local system.test.ts that checks the Trinity prompt is returned for arcee-ai/trinity-large-preview:free, arcee-ai/trinity-mini, and arcee-ai/trinity-mini:free; those tests passed. Also ran OpenCode in the terminal (TUI), selected arcee-ai/trinity-large-preview:free via OpenRouter, sent a message, and used temporary debug logging to confirm the model was detected and the Trinity prompt was selected. Internal testing was done with prompts designed to trigger the behaviors we wanted to avoid (e.g. parallel tool calls, repeating the same tool with the same params, etc). Model behaviour was on par with expectations.

**Original Pull Request:** https://github.com/anomalyco/opencode/pull/12144 **State:** closed **Merged:** Yes --- ### What does this PR do? Adds system prompt support for Trinity models (e.g. via OpenRouter). When the model id contains "trinity", we use a dedicated prompt that: uses exactly one tool per message, waits for the result before continuing, uses the question tool when the request is vague, and avoids repeating the same tool with the same params. The prompt is a small change on top of the default: same content except the “Tool usage policy” and “Doing tasks” sections are replaced with these Trinity rules. Routing is a single check in SystemPrompt.provider() in system.ts before the default branch. Closes #12146 ### How did you verify your code works? Added a local system.test.ts that checks the Trinity prompt is returned for arcee-ai/trinity-large-preview:free, arcee-ai/trinity-mini, and arcee-ai/trinity-mini:free; those tests passed. Also ran OpenCode in the terminal (TUI), selected arcee-ai/trinity-large-preview:free via OpenRouter, sent a message, and used temporary debug logging to confirm the model was detected and the Trinity prompt was selected. Internal testing was done with prompts designed to trigger the behaviors we wanted to avoid (e.g. parallel tool calls, repeating the same tool with the same params, etc). Model behaviour was on par with expectations.
yindo added the pull-request label 2026-02-16 18:18:54 -05:00
yindo closed this issue 2026-02-16 18:18:54 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#14085