Skip to content

fix(sandbox): add missing writable paths for tool state directories#457

Merged
RyderFreeman4Logos merged 1 commit intomainfrom
fix/sandbox-writable-paths
Mar 22, 2026
Merged

fix(sandbox): add missing writable paths for tool state directories#457
RyderFreeman4Logos merged 1 commit intomainfrom
fix/sandbox-writable-paths

Conversation

@RyderFreeman4Logos
Copy link
Owner

Summary

  • Add ~/.gemini to with_tool_defaults() for gemini-cli (OAuth tokens, session history, project settings)
  • Add CSA project-level state root and global slots directory for all tools (fork-call session creation, lock files)
  • Add 6 new tests covering gemini-cli/opencode defaults and CSA state path injection

Not added (by design):

  • ~/.claude-mem: MCP servers run outside bwrap, no filesystem sandbox needed
  • Entire CSA state root: too broad scope, only project-specific dir + slots

Test 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-commit passes (fmt, clippy, 2766 tests, e2e)
  • CSA review (tier-4-critical) clean

🤖 Generated with Claude Code

- 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>
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment on lines 195 to +197
"gemini-cli" => {
// OAuth tokens, session history, project settings
self.writable_paths.push(home.join(".gemini"));

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

@RyderFreeman4Logos RyderFreeman4Logos merged commit bcfafd0 into main Mar 22, 2026
4 of 6 checks passed
@RyderFreeman4Logos RyderFreeman4Logos deleted the fix/sandbox-writable-paths branch March 22, 2026 15:24
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