mirror of
https://gitea.toothfairyai.com/ToothFairyAI/tf_code.git
synced 2026-04-04 08:03:14 +00:00
fix(opencode): scope agent variant to model (#11410)
This commit is contained in:
@@ -827,6 +827,17 @@ export namespace SessionPrompt {
|
||||
|
||||
async function createUserMessage(input: PromptInput) {
|
||||
const agent = await Agent.get(input.agent ?? (await Agent.defaultAgent()))
|
||||
|
||||
const model = input.model ?? agent.model ?? (await lastModel(input.sessionID))
|
||||
const variant =
|
||||
input.variant ??
|
||||
(agent.variant &&
|
||||
agent.model &&
|
||||
model.providerID === agent.model.providerID &&
|
||||
model.modelID === agent.model.modelID
|
||||
? agent.variant
|
||||
: undefined)
|
||||
|
||||
const info: MessageV2.Info = {
|
||||
id: input.messageID ?? Identifier.ascending("message"),
|
||||
role: "user",
|
||||
@@ -836,9 +847,9 @@ export namespace SessionPrompt {
|
||||
},
|
||||
tools: input.tools,
|
||||
agent: agent.name,
|
||||
model: input.model ?? agent.model ?? (await lastModel(input.sessionID)),
|
||||
model,
|
||||
system: input.system,
|
||||
variant: input.variant,
|
||||
variant,
|
||||
}
|
||||
using _ = defer(() => InstructionPrompt.clear(info.id))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user