fix(tui): dedupe file references in prompt (#4775)

This commit is contained in:
Tommy D. Rossi 2025-11-26 18:26:05 +01:00 committed by GitHub
parent c33920f59d
commit 382758790c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -150,9 +150,12 @@ export namespace SessionPrompt {
},
]
const files = ConfigMarkdown.files(template)
const seen = new Set<string>()
await Promise.all(
files.map(async (match) => {
const name = match[1]
if (seen.has(name)) return
seen.add(name)
const filepath = name.startsWith("~/")
? path.join(os.homedir(), name.slice(2))
: path.resolve(Instance.worktree, name)