Skip to content

fix(reporting): skip symlinks and special files in the GCS artifact zip - #721

Merged
omkargaikwad23 merged 3 commits into
mainfrom
fix/gcs-artifact-skip-symlinks
Nov 20, 2026
Merged

omkargaikwad23 merged 3 commits into
mainfrom
fix/gcs-artifact-skip-symlinks

Conversation

@omkargaikwad23

@omkargaikwad23 omkargaikwad23 commented Nov 20, 2026 •

Copy link
Copy Markdown
Collaborator

What this fixes

GcsReporter zips the sandbox directory of an agent run and uploads it. The agent under test writes that directory. The zip step followed symlinks, so a symlink in the sandbox added a file from outside the sandbox to the upload.

How

  • Add only regular files to the zip. Skip symlinks and special files such as FIFOs.
  • os.walk already did not enter symlinked directories. The PR makes this explicit (followlinks=False) and adds a test.
  • Log the number of skipped files.

Limits

  • A hard link is a regular file, so the zip includes it.
  • The check and the read are two steps. A process that still writes the sandbox during the zip step can change a file between them.

Testing

  • New tests in gcs_artifact_test.py: a symlink to a file, a nested symlink, a symlink to a directory, and a FIFO.
  • pytest evalbench/test with SKIP_CLOUD_TESTS=true: 1266 passed, 11 skipped.

The agent under test writes the sandbox directory. Add only regular files to the zip, so that a symlink cannot add a file from outside the sandbox and a FIFO cannot block the reporter.
@omkargaikwad23

Copy link
Copy Markdown
Collaborator Author

/gcbrun

1 similar comment
@omkargaikwad23

Copy link
Copy Markdown
Collaborator Author

/gcbrun

@omkargaikwad23
omkargaikwad23 merged commit 77d30b8 into main Nov 20, 2026
12 of 13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants