[PR #12025] feat: add Trinity model system prompt support #14035

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

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

State: closed
Merged: Yes


What does this PR do?

Adds system prompt support for Trinity models (via OpenRouter) to address known behaviours with tool calling and the model looping. When the model id contains "trinity", we use a dedicated prompt: XML-only tool calls, exactly one tool per message, wait for the result before continuing, use the question tool when the request is vague, and avoid repeating the same tool with the same params. The prompt is a small change on top of the default prompt: same content except the "Tool usage policy" section is replaced with these Trinity rules. Routing is a single check in SystemPrompt.provider() in system.ts before the default branch.

Closes #12027

How did you verify your code works?

Locally added a system.test.ts file to 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.

**Original Pull Request:** https://github.com/anomalyco/opencode/pull/12025 **State:** closed **Merged:** Yes --- ### What does this PR do? Adds system prompt support for Trinity models (via OpenRouter) to address known behaviours with tool calling and the model looping. When the model id contains "trinity", we use a dedicated prompt: XML-only tool calls, exactly one tool per message, wait for the result before continuing, use the question tool when the request is vague, and avoid repeating the same tool with the same params. The prompt is a small change on top of the default prompt: same content except the "Tool usage policy" section is replaced with these Trinity rules. Routing is a single check in SystemPrompt.provider() in system.ts before the default branch. Closes #12027 ### How did you verify your code works? Locally added a system.test.ts file to 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.
yindo added the pull-request label 2026-02-16 18:18:51 -05:00
yindo closed this issue 2026-02-16 18:18:51 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#14035