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:
@@ -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)],
|
||||
|
||||
Reference in New Issue
Block a user