Skip to content

Keep every file in Download all when names collide - #400

Merged
abhishekgahlot2 merged 1 commit into
useagenthq:mainfrom
coolestnick:fix/download-all-name-collisions
Nov 2, 2026
Merged

abhishekgahlot2 merged 1 commit into
useagenthq:mainfrom
coolestnick:fix/download-all-name-collisions

Conversation

@coolestnick

@coolestnick coolestnick commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

Closes #248

What changed

  • Download all could silently drop a file: a generated name like a (2).txt could match a real file, and the ZIP kept only one.
  • Every real name is now reserved first, and a repeat takes the lowest free suffix, so a real file always keeps its own name.
  • Names are compared ignoring case and accent encoding, so Report.pdf and report.pdf no longer overwrite each other when unzipped on macOS or Windows. The ZIP keeps each file's spelling.

Testing

Real GET /api/artifacts/runs/:runId/archive route, 5 published files named a.txt, a.txt, a (2).txt, Report.txt, report.txt:

Files in ZIP Names
Before 4 of 5 a.txt, a (2).txt, Report.txt, report.txt
After 5 of 5 a.txt, a (2).txt, a (3).txt, Report (2).txt, report.txt
  • cd packages/artifact-formats && bun run test: 35 pass, 0 fail
  • backend/test/artifacts.test.ts: 40 pass, 0 fail
  • bun run typecheck and bun test scripts/agent-docs.test.ts: pass

This change has no visible UI, so the table is the before and after. The Download all button itself was not clicked in a browser.


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.

A generated name like "a (2).txt" could match a real file, and the ZIP
kept only one of them. Names differing only by case also overwrote each
other when unzipped on macOS or Windows.

Reserve every real name first, then give a repeat the lowest free suffix,
comparing names without regard to case or accent encoding.
@abhishekgahlot2
abhishekgahlot2 merged commit d15d95a into useagenthq:main Nov 2, 2026
20 checks passed
@abhishekgahlot2

Copy link
Copy Markdown
Contributor

Merged, thanks @coolestnick. Nice catch on the case and accent collisions.

@github-actions github-actions Bot locked and limited conversation to collaborators Nov 2, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Keep every file in Download all when names collide

2 participants