fix: dispatched-job sandbox mounts ~/.agentflare read-only, blocking item done/comment/vent - #500
Conversation
Dispatched jobs run inside a bwrap sandbox with a read-only root, and ~/.agentflare (the MCP server's own sqlite state dir) wasn't in the bind-mount allowlist at all -- every write through it (item done, comment create, vent) failed silently with EROFS. Two dispatched jobs (items #112, #116) each finished real work but couldn't report it, leaving the tracker stuck showing not-done despite merge-ready PRs. Add a --bind-try (writable, skipped if missing) mount for ~/.agentflare alongside the existing home-dir binds, same pattern as the read-only HOME_CACHE_DIRS entries but writable since this dir needs to persist state back to the host rather than being contained per-job. Agentflare-Agent: claude-code Agentflare-Branch: task/120-fix-dispatched-job-sandbox-mounts-agentf Agentflare-Item: 120
|
Warning Review limit reachedYou’ve reached a temporary PR review limit under our Fair Usage Limits Policy. Next review available in: 13 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
Comment |
Confirmed exactly as predicted: the comment write failed with
attempt to write a readonly database— live proof the bug is real and that this fix can't self-verify until the daemon restarts with the new binary. I won't restart the production daemon myself since that's outside this task's scope and requires operator judgment.Summary
Root cause:
crates/agentflare-jobs/src/sandbox/bwrap/mod.rsbuilds thebwrapargument list for dispatched jobs. It binds.cargo/.rustup/.cache/.npmread-only viaHOME_CACHE_DIRS, but never mounted~/.agentflare(the MCP server's sqlite state dir) at all — so it stayed under the outer--ro-bind / /, and every write through it (item done,comment create,vent) failed silently withEROFS.Fix (committed as
4e3ab9e): added a--bind-try(writable, silently skipped if the dir is missing) mount for~/.agentflare, following the same pattern as the existing home-dir binds. Added two unit tests (agentflare_data_dir_bound_read_write_when_present,agentflare_data_dir_skipped_when_absent). Fullcargo build/clippyclean, all 17 sandbox tests pass.Live verification: I'm the dispatched agent for this exact item, running under the daemon's old sandbox (confirmed via
ps aux— no.agentflarebind in my own launch command). I reproduced the bug directly (touch ~/.agentflare/probe_120→EROFS) and then proved the circularity concern the handoff flagged: I calledmcp__flare__commentto report status and it failed withattempt to write a readonly database, exactly as expected, since my own session predates the fix.What's left: this is a code-level fix only — it takes effect the next time the daemon is rebuilt and restarted, since bwrap args are assembled once at dispatch time by the running daemon binary. I can't call
item doneor leave a tracker comment from this session for the reason above; whoever rebuilds/restarts the daemon should redispatch a test item afterward to confirm a fresh sandbox can actually write to~/.agentflareend-to-end.