mirror of
https://github.com/aljazceru/opencode.git
synced 2025-12-28 13:14:28 +01:00
fix: command model selection (#2448)
This commit is contained in:
@@ -1297,18 +1297,26 @@ export namespace Session {
|
||||
}),
|
||||
)
|
||||
|
||||
const model = await (async () => {
|
||||
if (command.model) {
|
||||
return Provider.parseModel(command.model)
|
||||
}
|
||||
if (command.agent) {
|
||||
const agent = await Agent.get(command.agent)
|
||||
if (agent.model) {
|
||||
return agent.model
|
||||
}
|
||||
}
|
||||
if (input.model) {
|
||||
return Provider.parseModel(input.model)
|
||||
}
|
||||
return undefined
|
||||
})()
|
||||
|
||||
return prompt({
|
||||
sessionID: input.sessionID,
|
||||
messageID: input.messageID,
|
||||
model: (() => {
|
||||
if (input.model) {
|
||||
return Provider.parseModel(input.model)
|
||||
}
|
||||
if (command.model) {
|
||||
return Provider.parseModel(command.model)
|
||||
}
|
||||
return undefined
|
||||
})(),
|
||||
model,
|
||||
agent,
|
||||
parts,
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user