fix(agent): always keep agent when model is explicitly configured

Previously, when an explicit model was configured, the agent name was
omitted to prevent opencode's built-in agent fallback chain from
overriding the user-specified model. This removes that conditional logic
and always passes the agent name alongside the model. Tests are updated
to reflect this behavior change.

🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
YeonGyu-Kim
2026-03-25 11:44:01 +09:00
parent bff74f4237
commit 42fb2548d6
6 changed files with 207 additions and 18 deletions
@@ -56,9 +56,7 @@ export async function sendSyncPrompt(
const promptArgs = {
path: { id: input.sessionID },
body: {
// When a custom model is configured, omit the agent name so opencode's
// built-in agent fallback chain does not override the user-specified model.
...(input.categoryModel ? {} : { agent: input.agentToUse }),
agent: input.agentToUse,
system: input.systemContent,
tools,
parts: [createInternalAgentTextPart(effectivePrompt)],