Compare commits

...

3 Commits

Author SHA1 Message Date
Aiden Cline e3cc9f26a4 refactor(tui): simplify command file deduplication 2026-06-11 22:44:56 -05:00
verdverm 06f5469be8 test: add regression test for command file dedup from $ARGUMENTS 2026-06-07 08:54:53 -07:00
verdverm 5917aec929 fix(tui): double file content injection in commands using $ARGUMENTS 2026-06-07 08:12:43 -07:00
+5 -1
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