Skip to content

Sonny: sandfs 0.9, frozen copies for folders on another disk, and a waiting task gives memory back - #271

Merged
lydakis merged 6 commits into
mainfrom
claude/project-thread-dorvpr
Oct 28, 2026
Merged

lydakis merged 6 commits into
mainfrom
claude/project-thread-dorvpr

Conversation

@lydakis

@lydakis lydakis commented Oct 28, 2026 •

Copy link
Copy Markdown
Owner

What changes

  • Folders on another disk get frozen copies.
    • Sonny now uses sandfs = "0.9".
    • Until now, a plain folder on another disk than sandfs's home (an external volume such as /Volumes/workplace) got a live workspace laid over the folder itself, "over mode".
    • sandfs 0.9 instead keeps a frozen copy of that folder on the folder's own disk, in a .sandfs folder at the disk's top (sandfs#189).
    • So over mode goes, along with same_disk. Every plain folder now gets a copy of the folder as it is now: a file the task looked at no longer stays as it first saw it, and --apply refuses a file changed in the folder since, unless given --force.
  • Full copy where cloning isn't possible. A plain folder is forked with allow_copy, so on a disk that can't clone files (ext4) its files are copied in full rather than the task being refused.
  • A waiting task gives memory back.
    • New task::trim(name): when a task is done, has failed or needs the person, Sonny calls sandfs's new Home::trim for that task's copy, on its own thread.
    • Home::trim saves the copy's writes, drops listings, file bytes and idle git helpers, and hands the freed memory back to the system.
    • sandfs also trims a mount on its own after a minute unused; this is just sooner.
    • The trim runs only when the task's workspace is the one mounted at ~/.agent/tasks/NAME.

Tests

  • The test for the old behaviour is now a_plain_folder_on_another_disk_is_copied_on_that_disk. It checks that a change made to the folder after the copy doesn't show up in it, and that the task's edit stays in its copy until applied.
  • The linked-worktree test no longer expects the over-mode warning.
  • The unit test for same_disk is gone.
  • cargo test -p sonny: 271 unit tests and 12 task tests pass on Linux, against sandfs 0.9.0 from crates.io.

Note on the branch

This branch earlier held the commits of agent#252, which was closed as superseded by agent#227. A merge with the ours strategy keeps those commits in the branch's history, but none of their changes are in this PR's diff.

… over

sonny task done NAME, from the lead's folder, deletes the task and then
its folder: a sandfs copy (unmounted) or a worktree, whose branch stays
while its commits aren't merged. It refuses while the folder holds work
that is nowhere else: in a sandfs copy, files that differ from the lead's
folder and commits on no remote; in a worktree, uncommitted changes.
--apply writes a sandfs copy's changes back first, --discard drops them.
sonny task gc lists task folders whose task is gone, and Sonny no longer
mounts those again at start. The lead is told to end tasks this way.
task changes --apply now writes at the top of the folder the copy is of,
not in the lead's subfolder.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_013jkdGETmgGUb8hcSEpppQK
…ks the chosen daemon

A staged edit whose working file was put back, and a file made to run,
were taken as saved, so task done would delete the only copy of them.
Remount asked the default daemon for its bots even when Sonny was given
another store and socket.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_013jkdGETmgGUb8hcSEpppQK
…and a waiting task's copy gives memory back

sandfs 0.9 keeps the copy of a folder on another disk on that disk, in a
.sandfs folder at its top, so the workspace over the folder itself (over
mode) goes: a file the task looked at no longer stays as it first saw it,
and --apply refuses what changed in the folder meanwhile. A plain folder on
a disk that can't clone files is copied in full. A task that is done,
failed or needs the person has its copy trim what it can read again.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_013jkdGETmgGUb8hcSEpppQK
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-28T04:29:56.300280Z 4762b5a New commits
🔒 Security Review ✅ Completed 2026-10-28T04:32:15.570985Z 4762b5a New commits
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

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.

2 participants