fix(sandbox): add missing writable paths for tool state directories#457
fix(sandbox): add missing writable paths for tool state directories#457RyderFreeman4Logos merged 1 commit intomainfrom
Conversation
- Add ~/.gemini to with_tool_defaults() for gemini-cli (OAuth tokens, session history, project settings stored there, not in ~/.config/gemini-cli) - Add CSA project-level state root and global slots directory to pipeline_sandbox.rs for all tools (enables fork-call session creation and lock file writes in sandboxed environments) - Add 6 new tests: tool_defaults for gemini-cli and opencode, pipeline_sandbox tests for CSA state path injection and REPLACE semantics survival - Bump version to 0.1.160 Not added (by design): - ~/.claude-mem: MCP servers run outside bwrap, no filesystem sandbox - Entire CSA state root: too broad, only project-specific dir + slots Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 25b52df8a5
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| "gemini-cli" => { | ||
| // OAuth tokens, session history, project settings | ||
| self.writable_paths.push(home.join(".gemini")); |
There was a problem hiding this comment.
Avoid binding
~/.gemini before the directory exists
On Linux hosts that use bubblewrap, this new writable path will break sandboxed gemini-cli launches whenever ~/.gemini has not been created yet (for example, first-time users or setups that only have the XDG config dir). with_tool_defaults() now always appends ~/.gemini, and csa-resource/src/bwrap.rs turns every writable path into --bind src src without checking that src exists, so the child fails before Gemini can create the directory itself. Binding an existing parent or creating the directory up front avoids that regression.
Useful? React with 👍 / 👎.
Summary
~/.geminitowith_tool_defaults()for gemini-cli (OAuth tokens, session history, project settings)Not added (by design):
~/.claude-mem: MCP servers run outside bwrap, no filesystem sandbox neededTest plan
cargo test -p csa-resource -- test_tool_defaults(4 tests pass)cargo test -p cli-sub-agent -- csa_state_paths(2 tests pass)just pre-commitpasses (fmt, clippy, 2766 tests, e2e)🤖 Generated with Claude Code