Add a --tool-dir run option#41
Merged
Merged
Conversation
…andbox A corpus may require tools the per-agent images don't ship (e.g. a runnable `transformers`). `--tool-dir` bind-mounts a self-contained dir read-only at its host path and prepends its `bin/` to the agent's PATH, so the agent can invoke it without rebuilding images (the src==dst mount keeps the bundle's interpreter shebangs valid in-container). By convention a bundle that ships a prewarmed `hf-cache/` sibling is read offline (HF_HOME + HF_HUB_OFFLINE), so the read-only mount needs no network or writes. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Unit: extract the --tool-dir sandbox derivation into a pure `tool_dir_wiring` so it's testable without a sandbox, and assert it points AGENTCAP_TOOL_BIN at bin/ while mounting the bundle root (so an hf-cache/ sibling rides along), absolutizing relative paths. Live: mount a fixture bundle through a real image and probe the entrypoint directly (no model) to assert bin/ lands on PATH, the tool runs, and an hf-cache/ sibling flips HF offline. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
run_agent (live_pi/live_goose) only skipped on a missing model server; a missing podman fell through to a hard failure (the binary bails in require_sandbox). Gate on podman_available() too so every live test skips on its missing prerequisite rather than one of them failing. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 allows the caller to add a runnable tool that can be used by the agent (like an MCP tool or a CLi described by a skill).