fix(opencode): preserve variant for delegated tasks (#30630)

This commit is contained in:
Aiden Cline
2026-06-03 17:43:47 -05:00
committed by GitHub
parent d3d4335509
commit ee74dd83f5
2 changed files with 6 additions and 0 deletions

View File

@@ -172,6 +172,7 @@ export const TaskTool = Tool.define(
Effect.orDie,
)
if (msg.info.role !== "assistant") return yield* Effect.fail(new Error("Not an assistant message"))
const variant = msg.info.variant
const model = next.model ?? {
modelID: msg.info.modelID,
@@ -201,6 +202,7 @@ export const TaskTool = Tool.define(
modelID: model.modelID,
providerID: model.providerID,
},
variant: next.model ? undefined : variant,
agent: next.name,
tools: {
...(next.permission.some((rule) => rule.permission === "todowrite") ? {} : { todowrite: false }),
@@ -221,6 +223,7 @@ export const TaskTool = Tool.define(
.prompt({
sessionID: ctx.sessionID,
agent: currentParent.agent ?? ctx.agent,
variant,
parts: [
{
type: "text",