Repository navigation
Sonny: each repository inside an agent's folder keeps what git runs - #444
Conversation
A sandboxed agent could write the hooks and config of a repository inside its folder, below its own, which git then runs as the person. Sonny now gives each such repository's .git as a writable folder of its own, as it gives the folder's own repository: the daemon keeps a git folder's hooks, config, submodules and commondir read-only, and commits still run without asking. Repositories are looked for up to six folders down, never inside a repository or a hidden folder, nor through links; one cloned since makes the sandbox stale, so it is given on the next start. A repository the agent makes is its own, as Claude Code draws the line. Closes #414. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013jkdGCrDV3wjc6rUfmxAoc
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013jkdGCrDV3wjc6rUfmxAoc
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
The Generated by Claude Code |
Closes #414.
Why
The daemon's sandbox keeps
.git/hooksandconfigread-only only at the top of a writable folder. A sandboxed agent whose folder holds repositories below its own, such as a workspace of packages, could write their hooks and config. Git then runs those as the person, outside any sandbox: the nextgitthe person runs there, or Sonny's owngit worktree addfor a task givenfolder(#409).George's call: the daemon shouldn't care what a bot does; the client decides. No daemon change is needed. The daemon already guards any git folder (
.git,NAME.git) a client gives inwritable: hooks, config, config.worktree, modules and commondir stay read-only, and commits still work. Sonny already does this for a folder's own repository.What
approvals::sandbox(every lead and task Sonny configures) now also gives each repository inside the agent's folder as a writable git folder of its own. It looks for them:A linked checkout's
.gitfile names a folder elsewhere and is left out. A repository cloned later leaves the agent's recorded sandbox stale, so it is picked up the next time Sonny starts or reconfigures the agent. A repository the agent makes itself is its own, which is where Claude Code draws the line too. At most 64 folders, the daemon's bound, keeping the shallowest.FEATURES.md: the sandbox row's history.
Tests
approvals::tests::the_repositories_inside_an_agent_s_folder_are_given_as_folders_of_their_own:.gitfile;tests/test_approvals.pypins the daemon behavior this relies on. With a nested.gitgiven inwritable:.gitaside, fails;Locally,
cargo fmt --check,cargo clippy --workspace --all-targets -D warnings, the Sonny tests, and the new runtime test (with bubblewrap) pass.