Skip to content

Add a --tool-dir run option#41

Merged
dacorvo merged 3 commits into
mainfrom
feat/tool-dir
Jun 26, 2026
Merged

Add a --tool-dir run option#41
dacorvo merged 3 commits into
mainfrom
feat/tool-dir

Conversation

@dacorvo

@dacorvo dacorvo commented Jun 26, 2026

Copy link
Copy Markdown
Collaborator

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).

dacorvo and others added 3 commits June 26, 2026 11:43
…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>
@dacorvo dacorvo merged commit ecf7779 into main Jun 26, 2026
7 checks passed
@dacorvo dacorvo deleted the feat/tool-dir branch June 26, 2026 10: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.

1 participant