fabro/lib/crates/fabro-sandbox/src
Bryan Helmkamp 762ac19649
fix(sandbox): resolve bash via PATH instead of /bin/bash (#241)
## Summary

The local sandbox provider hard-codes `/bin/bash` at three call sites in
`fabro-sandbox/src/local.rs` (`exec_command`, `exec_command_streaming`,
`spawn_stdio_process`). NixOS doesn't ship `/bin/bash` — only `/bin/sh`
and `/usr/bin/env` are managed under `/`, with bash living on `PATH` at
`/run/current-system/sw/bin/bash`. The result: a first run on NixOS dies
on the very first sandbox call (the git probe) with `No such file or
directory (os error 2)`, surfaced as `sandbox git unavailable`.

## Fix

Switch all three sites from `Command::new("/bin/bash")` to
`Command::new("bash")`. `PATH` is already preserved by
`filtered_env_vars` (and explicitly tested at `local.rs:1164`), so
libc's `execvp` lookup resolves bash on every distribution that has it
installed, including NixOS, without forcing users to symlink
`/bin/bash`.

The `/bin/bash` references in `docker.rs` are unaffected — those execute
inside containers where the path always exists.

## Credit

Diagnosis and proposed fix by @allouis in #232 — they ran the
PATH-lookup variant locally on NixOS 26.05 and confirmed workflows ran
cleanly without the symlink workaround.

Closes #232

---

[![Compound Engineering
v2.60.0](https://img.shields.io/badge/Compound_Engineering-v2.60.0-6366f1)](https://github.com/EveryInc/compound-engineering-plugin)
🤖 Generated with Claude Opus 4.7 (1M context, extended thinking) via
[Claude Code](https://claude.com/claude-code)

Co-authored-by: Fabien O'Carroll <3218915+allouis@users.noreply.github.com>
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-12 10:31:12 -04:00
..
daytona Add ACP backend support (#237) 2026-05-11 23:39:43 -04:00
clone_source.rs fix(lints): resolve clippy errors after error-chain refactor 2026-04-27 11:37:09 -07:00
config.rs refactor(workflow): remove local worktree mode 2026-05-09 11:04:23 -04:00
details.rs Add ACP backend support (#237) 2026-05-11 23:39:43 -04:00
docker.rs Add ACP backend support (#237) 2026-05-11 23:39:43 -04:00
error.rs fix(workflow): retain exec output tails on failures 2026-05-03 21:30:34 -04:00
lib.rs Add ACP backend support (#237) 2026-05-11 23:39:43 -04:00
local.rs fix(sandbox): resolve bash via PATH instead of /bin/bash (#241) 2026-05-12 10:31:12 -04:00
read_guard.rs Add ACP backend support (#237) 2026-05-11 23:39:43 -04:00
reconnect.rs feat(api): unify public run shape 2026-05-10 20:48:55 -04:00
redact.rs fix(run): enforce validation when create_run is quiet 2026-04-29 15:45:37 -04:00
sandbox.rs Add ACP backend support (#237) 2026-05-11 23:39:43 -04:00
sandbox_spec.rs feat(api): unify public run shape 2026-05-10 20:48:55 -04:00
terminal.rs feat(api): unify public run shape 2026-05-10 20:48:55 -04:00
test_support.rs fix(acp): tolerate clean stdio exit after final response 2026-05-12 09:03:53 -04:00
worktree.rs Add ACP backend support (#237) 2026-05-11 23:39:43 -04:00