test(tui): delivery_tests sandbox case fails when the workspace lives under /tmp (bwrap --tmpfs /tmp shadows it)
- Dominant language
- Rust
- Stars
- 41k
- Forks
- 3.6k
- Avg merge
- 13h 59m
- Merged PRs (30d)
- 299
Description
## Observed (deterministic, isolation)
On the CI lane (x86_64 Linux), the sandbox delivery test fails whenever the test workspace is a `tempfile` under `/tmp`:
```
cargo test -p codewhale-tui --lib --locked \
tools::subagent::delivery_tests::enforced_readonly_python_queries_sqlite_under_a_live_peer_write_claim -- --exact
panicked: called `Result::unwrap()` on an `Err` value:
Failed to execute tool: bwrap: Can't chdir to /tmp/.tmpN8FjYQ: No such file or directory
```
## Root cause
`crates/tui/src/sandbox/bwrap.rs` mounts `--tmpfs /tmp` and then binds the workspace roots. A workspace that itself lives under `/tmp` is shadowed by the tmpfs, so the subsequent `--chdir ` targets a path that no longer exists inside the sandbox.
## Pre-existing?
Yes — it fails identically at the pre-change control commit for the current fleet work, and the code path is untouched by it. It is a test-environment interaction, not a product regression.
## Suggested fix
Test-side: create the sandbox fixture workspace outside `/tmp` on Linux (the crate already knows the sandbox layout). Do not weaken the `--tmpfs /tmp` isolation, which is deliberate.
Seen during the 2026-09-17 fleet-rework lane runs; reported by the Codewhale night program.
Contributor guide
Research direction
Run the exact cargo test command for tools::subagent::delivery_tests::enforced_readonly_python_queries_sqlite_under_a_live_peer_write_claim, then inspect its sandbox fixture and crates/tui/src/sandbox/bwrap.rs. On Linux, place the test workspace outside /tmp while preserving the deliberate --tmpfs /tmp isolation. Done means the exact test passes in the affected environment.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- linux, rust
- Domain
- cli, operating-systems, testing
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 82/100