You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
refactor: route filesystem archives through host - #461
This PR routes our filesystem-backed tar operations through Host so scenario builds and sandbox file transfers use the selected host filesystem. As a result, virtual hosts can handle archives without reading or writing the system filesystem.
Stream-only tar-stream usage stays unchanged.
Changelog
New
Add host-bound archive packing and extraction.
Add a lint rule that prevents direct tar-fs imports outside the host adapter.
Changed
Update scenario image builds and sandbox copy/download operations to use host archives.
Update archive coverage to exercise real packing and extraction with in-memory filesystems.
The reason will be displayed to describe this comment to others. Learn more.
🟢 Approval recommended
The narrow refactor preserves archive options and adds targeted regression coverage, with no blocking issues identified in static review; tests were not executed.
No open issues 🎉
What changed in this PR
Routes filesystem-backed archives through Host, allowing scenario builds and sandbox transfers to use the selected filesystem without virtual hosts accessing system files.
Changes:
Add host-bound archive packing and extraction while preserving existing options.
Update scenario and sandbox callers, with tests covering archive isolation, exclusions, and renaming.
Restrict direct tar-fs imports to the host adapter; stream-only usage remains unchanged.
Fixed the virtual archive mocks to use the current filesystem owner, avoiding memfs permission errors when tar-fs remaps archive ownership. Commit: 3f73ce4. Full unit tests and the build, format, lint, and type-check tasks pass.
The reason will be displayed to describe this comment to others. Learn more.
🔵 Needs a closer look
The public Host change exposes dev-only tar-fs typings to consumers and breaks existing custom hosts without migration guidance or backward compatibility.
No open issues 🎉
2 previously missed issues
In code that hasn't changed since last review
Preserve compatibility for existing custom host implementations
packages/agent-eval/src/host.ts:11
This required member also changes the public injected-host contract: getScenario accepts Host (packages/agent-eval/src/scenario/get.ts:5–8) and is exported from the package root. Existing custom hosts providing fs, loadModule, and createSandbox now fail type checking, including for discovery operations that never use archives. Please add a versioned migration guide and index entry under packages/agent-eval/docs/migrations/ showing how custom hosts provide filesystem-bound pack and extract, or preserve compatibility with the previous host shape.
Expose archive typings through production dependencies
packages/agent-eval/src/host.ts:11
Host is reachable through the exported getScenario options (packages/agent-eval/src/scenario/get.ts:5–8), so this member introduces a tar-fs import into consumer-facing declarations. The build externalizes dependencies (packages/agent-eval/rolldown.config.ts:9–12), but @types/tar-fs is only a devDependency (packages/agent-eval/package.json:64–72), leaving strict TypeScript consumers without the required declarations. Move the required archive typings into production dependencies, or expose an archive interface without dev-only type dependencies.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR routes our filesystem-backed tar operations through
Hostso scenario builds and sandbox file transfers use the selected host filesystem. As a result, virtual hosts can handle archives without reading or writing the system filesystem.Stream-only
tar-streamusage stays unchanged.Changelog
New
tar-fsimports outside the host adapter.Changed
Removed