Skip to content

fix(runtime): skip unreadable local source entries - #908

Open
ousamabenyounes wants to merge 1 commit into
usestrix:mainfrom
ousamabenyounes:fix/issue-749-localdir-read-error
Open

fix(runtime): skip unreadable local source entries#908
ousamabenyounes wants to merge 1 commit into
usestrix:mainfrom
ousamabenyounes:fix/issue-749-localdir-read-error

Conversation

@ousamabenyounes

Copy link
Copy Markdown
Contributor

Fixes #749.

Summary

  • Detect local source trees that contain entries the SDK LocalDir walker cannot traverse safely.
  • Stage those trees into a LocalDir-safe temp copy before sandbox upload.
  • Skip unreadable files/directories during staging with a warning instead of handing the raw tree to the SDK and aborting the scan.

Test verification (RED -> GREEN)

RED on origin/main with only the regression test added:

$ uv run pytest tests/test_local_dir_staging.py::test_unreadable_child_is_skipped_before_localdir_upload -q
E   PermissionError: [Errno 13] Permission denied: 'unreadable'
E   agents.sandbox.errors.LocalDirReadError: failed to read local dir artifact: /tmp/.../repo
1 failed

GREEN after the fix:

$ uv run pytest tests/test_local_dir_staging.py::test_unreadable_child_is_skipped_before_localdir_upload -q
1 passed

Fix-reverted proof:

$ git apply -R /tmp/strix-issue-749-fix.patch && uv run pytest tests/test_local_dir_staging.py::test_unreadable_child_is_skipped_before_localdir_upload -q
E   agents.sandbox.errors.LocalDirReadError: failed to read local dir artifact: /tmp/.../repo
1 failed

Validation

  • uv run pytest tests/test_local_dir_staging.py tests/test_session_entries.py -q -> 14 passed
  • uv run ruff check strix/runtime/local_dir_staging.py tests/test_local_dir_staging.py -> pass
  • uv run ruff format --check strix/runtime/local_dir_staging.py tests/test_local_dir_staging.py -> pass
  • uv run mypy strix/runtime/local_dir_staging.py tests/test_local_dir_staging.py -> pass
  • uv run bandit -q -c pyproject.toml strix/runtime/local_dir_staging.py -> pass

@greptile-apps

greptile-apps Bot commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

Improves local source staging so SDK uploads avoid unreadable entries.

  • Detects symlinks and inaccessible files or directories before selecting the upload path.
  • Stages affected trees into a temporary safe copy while warning and skipping inaccessible entries.
  • Adds a regression test covering an unreadable child directory and successful LocalDir enumeration.

Confidence Score: 5/5

The PR appears safe to merge, with no actionable defects identified in the changed paths.

The staging flow now detects inaccessible entries before SDK upload, catches directory traversal failures during staging, and omits unreadable children while preserving accessible source files.

Important Files Changed

Filename Overview
strix/runtime/local_dir_staging.py Extends the staging gate and copy traversal to detect and skip inaccessible source entries without exposing a concrete regression.
tests/test_local_dir_staging.py Adds focused regression coverage proving that unreadable child content is excluded before the SDK walks the staged source.

Reviews (1): Last reviewed commit: "fix(runtime): skip unreadable local sour..." | Re-trigger Greptile

@ousamabenyounes
ousamabenyounes force-pushed the fix/issue-749-localdir-read-error branch from 7403b56 to 96b0ef2 Compare July 27, 2026 20:36
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.

Local directory scan fails with LocalDirReadError on readable repo (v1.0.4, Fedora)

1 participant