vtcode-bash-runner
July 6, 2026 · View on GitHub
Root AGENTS.md | Cross-platform command runner with workspace-safe operations.
Modules
executor CommandExecutor trait + backends | runner BashRunner | policy CommandPolicy + WorkspaceGuardPolicy | pipe async process spawning | process handles | process_group kill/cleanup | background long-running tasks | stream utilities
Rules
CommandExecutortrait = primary abstraction for new backends.CommandPolicytrait = execution gate.WorkspaceGuardPolicyenforces boundaries.- Feature flags:
dry-run,pure-rust,exec-events,serde-errors. unsafeinprocess_groupmust have// SAFETY:comments.
Testing
cargo nextest run -p vtcode-bash-runner | pipe tests: cargo nextest run -p vtcode-bash-runner -E 'binary(/pipe_tests/)' | use AllowAllPolicy unless testing policy.
Gotchas
BashRunner::new()canonicalizes root — bails if missing.path_cacheis LRU (256) — no fresh canonicalize every call.remove_env_varis unsafe, single-threaded startup only.policycontainment delegates tovtcode_commons::paths::ensure_path_within_workspace—..-traversal paths are rejected (intentionally stricter than the oldstarts_with).