fix(tui): double file content injection in commands using $ARGUMENTS (#31245)
Co-authored-by: Aiden Cline <aidenpcline@gmail.com>
This commit is contained in:
parent
fe2e4e21d0
commit
a9c810cbbc
@ -1491,6 +1491,12 @@ export const layer = Layer.effect(
|
||||
}
|
||||
|
||||
const templateParts = yield* resolvePromptParts(template)
|
||||
const inputFiles = new Set(
|
||||
input.parts?.filter((part) => new URL(part.url).protocol === "file:").map((part) => fileURLToPath(part.url)),
|
||||
)
|
||||
const uniqueTemplateParts = templateParts.filter(
|
||||
(part) => part.type !== "file" || !inputFiles.has(fileURLToPath(part.url)),
|
||||
)
|
||||
const isSubtask = (agent.mode === "subagent" && cmd.subtask !== false) || cmd.subtask === true
|
||||
const parts = isSubtask
|
||||
? [
|
||||
@ -1503,7 +1509,7 @@ export const layer = Layer.effect(
|
||||
prompt: templateParts.find((y) => y.type === "text")?.text ?? "",
|
||||
},
|
||||
]
|
||||
: [...templateParts, ...(input.parts ?? [])]
|
||||
: [...uniqueTemplateParts, ...(input.parts ?? [])]
|
||||
|
||||
const userAgent = isSubtask ? (input.agent ?? (yield* agents.defaultInfo()).name) : agent.name
|
||||
const userModel = isSubtask
|
||||
|
||||
Loading…
Reference in New Issue
Block a user