mirror of
https://github.com/sst/opencode.git
synced 2025-12-23 10:11:41 +00:00
fix: command model selection (#2448)
Some checks are pending
deploy / deploy (push) Waiting to run
Some checks are pending
deploy / deploy (push) Waiting to run
This commit is contained in:
parent
dc99005e65
commit
bffe547417
1 changed files with 17 additions and 9 deletions
|
|
@ -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,
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue