Skip to content

Commit 3e1a758

Browse files
committed
fix: prioritize CLI --model argument over command markdown model
Fixes #17783 The CLI --model argument should have highest priority according to docs, but it was being overridden by model specified in command/agent markdown. Changed the priority order in session/prompt.ts to check input.model (CLI argument) before falling back to command.model and command.agent model.
1 parent 51fcd04 commit 3e1a758

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/opencode/src/session/prompt.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1804,6 +1804,7 @@ NOTE: At any point in time through this workflow you should feel free to ask the
18041804
template = template.trim()
18051805

18061806
const taskModel = await (async () => {
1807+
if (input.model) return Provider.parseModel(input.model)
18071808
if (command.model) {
18081809
return Provider.parseModel(command.model)
18091810
}
@@ -1813,7 +1814,6 @@ NOTE: At any point in time through this workflow you should feel free to ask the
18131814
return cmdAgent.model
18141815
}
18151816
}
1816-
if (input.model) return Provider.parseModel(input.model)
18171817
return await lastModel(input.sessionID)
18181818
})()
18191819

0 commit comments

Comments
 (0)