Skip to content

fix: dispatched-job sandbox mounts ~/.agentflare read-only, blocking item done/comment/vent - #500

Merged
getappz merged 2 commits into
masterfrom
task/120-fix-dispatched-job-sandbox-mounts-agentf
Aug 15, 2026
Merged

fix: dispatched-job sandbox mounts ~/.agentflare read-only, blocking item done/comment/vent#500
getappz merged 2 commits into
masterfrom
task/120-fix-dispatched-job-sandbox-mounts-agentf

Conversation

@getappz

@getappz getappz commented Aug 15, 2026

Copy link
Copy Markdown
Owner

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.rs builds the bwrap argument list for dispatched jobs. It binds .cargo/.rustup/.cache/.npm read-only via HOME_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 with EROFS.

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). Full cargo build/clippy clean, 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 .agentflare bind in my own launch command). I reproduced the bug directly (touch ~/.agentflare/probe_120EROFS) and then proved the circularity concern the handoff flagged: I called mcp__flare__comment to report status and it failed with attempt 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 done or 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 ~/.agentflare end-to-end.

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
@coderabbitai

coderabbitai Bot commented Aug 15, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You’ve reached a temporary PR review limit under our Fair Usage Limits Policy.

Your recent review volume is higher than typical usage, so adaptive limits are currently applied.

Next review available in: 13 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 2243a511-a56a-4af7-acb9-0a1d65ece0b9

📥 Commits

Reviewing files that changed from the base of the PR and between 78961cf and 11581a1.

📒 Files selected for processing (1)
  • crates/agentflare-jobs/src/sandbox/bwrap/mod.rs

Comment @coderabbitai help to get the list of available commands.

@getappz getappz changed the title Fix: dispatched-job sandbox mounts ~/.agentflare read-only, blocking item done/comment/vent fix: dispatched-job sandbox mounts ~/.agentflare read-only, blocking item done/comment/vent Aug 15, 2026
@getappz
getappz merged commit 0e3cc10 into master Aug 15, 2026
16 checks passed
@getappz
getappz deleted the task/120-fix-dispatched-job-sandbox-mounts-agentf branch August 15, 2026 07:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant