Repository navigation
Description
Summary
A bb-managed worktree can present two different views to shell commands inside one
thread. Sometimes the commands see the full checkout; at other times the same
directory holds only the file that was written last. In the second view npm ci
falls back to the local prefix /home/elche, git reports not a git repository,
and test -f package.json fails, while a parallel ls "$P/package.json" succeeds.
Versions and environment
- bb 0.50.1
- Linux 7.2.5-3-omarchy, host
hq - install: the bb desktop install under
/home/elche/.bb - environment: a bb-managed worktree from the
environment-git-worktreeplugin - worktree:
/home/elche/.bb/plugins/environment-git-worktree/host-data/worktrees/thr_ys6qvjnnn6-1/services - agent: Pi provider, running shell commands through the Pi bash tool
Steps to reproduce
The two views alternate without a pattern, so this is the closest faithful repro.
- Open a thread whose environment is the managed worktree above.
- In a loop, run a command that reads the checkout, for example
cd <worktree> && ls -a | wc -l && git rev-parse --show-toplevel && test -f package.json. - Compare the answer with a parallel
ls "$P/package.json"in the same turn.
About 30 consecutive retries in a loop never gave a consistent view.
Unverified: I am the filer of this report, not the reporter. I sampled the same
worktree path myself in 6 runs and saw the full view each time, so I could not
reproduce the empty view on demand. The report comes from a live session that hit
both views.
Expected vs actual
Actual, from the reporting session:
npm ci
npm error code ENOENT
npm error enoent Could not read package.json: Error: ENOENT: no such file or
directory, open '/home/elche/package.json'
git status
fatal: not a git repository (or any of the parent directories): .git
At the same moment, in the same turn:
ls "$P/package.json" # succeeds
/proc/1/root/<worktree path>/package.json # shows the file
Expected: one stable view of the worktree for every command in the thread. The
checkout on disk is correct, so a command should not see a short or empty
directory, and npm should not fall back to /home/elche.
Evidence
- Reporting session transcript:
npm cireturnsENOENTfor
/home/elche/package.json. - The entry count of the same directory oscillates between 3 and 36 while the
inode stays61924099. - My own samples of the same path (6 runs) show a stable full view:
ls -agives
8 entries,git rev-parse --show-toplevelreturns the worktree path, and the
directory inode is61924086. - The command runner reaches the same path, so the empty view looks like a view or
mount problem at command time, not a missing checkout.
What you ruled out
- Not a missing checkout:
/proc/1/root/<path>and a parallellsshow the file
while another command in the same turn does not. - Not the worktree itself: a plain
git worktree addunder~/NoxOS/.worktrees/
(branchservices-5-unifi-mcp) is stable across 12 samples. The unifi-mcp work
was moved there. - Not a stale checkout: repeated retries in one turn never settle on one view.
- Searched open and closed issues for
worktree,worktree empty,ENOENT,
not a git repositoryand the behavior words. No duplicate found.
Suggested priority and effort
Medium to high: it silently corrupts the view of the workspace, so any build or
test run in a managed worktree can fail or read the wrong tree. The workaround is a
plain git worktree add outside bb. Effort unknown.
Findings Log receipt: flr_2d4ef574-926f-4bda-9f2e-c6c7dfbbf427
AGENT GENERATED
Activity
bb-slop-cop commentedon Nov 29, 2026
🚨 SLOP COP 🚨 ·
new-issue-autopilotworkspaces,provider-pi,no-repro.