Compare commits

...
Sign in to create a new pull request.

3 commits

View file

@ -1558,6 +1558,7 @@ export const layer = Layer.effect(
} }
const templateParts = yield* resolvePromptParts(template) const templateParts = yield* resolvePromptParts(template)
const inputFiles = new Set(input.parts?.map((part) => new URL(part.url).pathname))
const isSubtask = (agent.mode === "subagent" && cmd.subtask !== false) || cmd.subtask === true const isSubtask = (agent.mode === "subagent" && cmd.subtask !== false) || cmd.subtask === true
const parts = isSubtask const parts = isSubtask
? [ ? [
@ -1570,7 +1571,10 @@ export const layer = Layer.effect(
prompt: templateParts.find((y) => y.type === "text")?.text ?? "", prompt: templateParts.find((y) => y.type === "text")?.text ?? "",
}, },
] ]
: [...templateParts, ...(input.parts ?? [])] : [
...templateParts.filter((part) => part.type !== "file" || !inputFiles.has(new URL(part.url).pathname)),
...(input.parts ?? []),
]
const userAgent = isSubtask ? (input.agent ?? (yield* agents.defaultInfo()).name) : agent.name const userAgent = isSubtask ? (input.agent ?? (yield* agents.defaultInfo()).name) : agent.name
const userModel = isSubtask const userModel = isSubtask