5 Commits

Author SHA1 Message Date
Arif Rahman
9134cf26c6
fix(gateway): reject artifact archives where a file collides with an implicit directory (#7977) (#8232)
* fix(gateway): reject artifact archives where a file collides with an implicit directory

When a run outputs both a file and a deeper file path whose parent directory
matches the first file's normalized name (e.g. 'Report' and
'report/slides/lesson.pptx', or Unicode NFC/NFD variations), the ZIP archive
builder allowed both entries because it only checked for exact full path
equality. On case-insensitive filesystems, extracting such archives fails because
the file entry blocks directory creation or vice versa.

This change collects all implicit directory prefixes from normalized casefolded
entries and rejects the archive with HTTP 409 (ArtifactArchiveError) if any file
entry name collides with an implicit directory, regardless of receipt order.

Fixes #7977

* fix(gateway): address review feedback on test portability and loop readability
2026-11-15 20:28:29 +08:00
EddieMurphy
ae871431a2
fix(sandbox): sanitize config-failure logs and map archive errors to 503 (#8185) 2026-11-13 20:41:27 +08:00
Totoro
3f9a78e02e
fix(goal,artifacts): verify completion and artifact handoff (#7961)
* fix(goal,artifacts): verify completion and artifact handoff

* fix(goal,artifacts): harden shared artifact handoff

* docs(agents): shrink inherited guidance to fit chain budget

---------

Co-authored-by: Totoro-qaq <279883115+Totoro-qaq@users.noreply.github.com>
2026-11-07 18:21:49 +08:00
Shxiao
e20b36b3c7
test(artifact-archive): make the archive suite platform-correct on Windows (#5365)
Two tests in this suite failed on Windows hosts for POSIX-shaped reasons:

- test_archive_download_contains_only_presented_files wrote its CSV fixture
  with write_text(), so Windows text mode translated the literal "\n" bytes to
  CRLF; the archive then legitimately contained CRLF while the assertion
  compared against the LF spelling.
- test_archive_rejects_a_path_replaced_during_read swaps the source file with
  os.replace() while the archive still holds it open, which Windows refuses
  with WinError 5, so that rename-under-read race is POSIX-only.

Write the fixture as bytes so its content is platform-independent, and skip
only the rename-based race on Windows: the same-size content change during
read (test_archive_rejects_same_size_content_change_with_restored_mtime) still
runs there and exercises the same mid-read revalidation.

Verified on Windows: both tests red on upstream main, green after the change
(one skipped); ruff check/format clean; the file is 28 passed, 7 skipped.
2026-09-12 07:12:37 +08:00
Ryker_Feng
8d8ca506ba
feat(artifacts): download run files as zip (#5117)
* feat(artifacts): download run files as zip

* fix(artifacts): address archive review feedback

* fix(artifacts): gate unavailable archive downloads

* fix(artifacts): verify archive availability

* fix(artifacts): harden archive consistency

* fix(artifacts): reject archive path aliases
2026-09-01 22:01:21 +08:00