hermes-agent/tools/environments
alt-glitch 37c478cf2f feat(file-sync): sync remote changes back to host on teardown
Add sync_back() to FileSyncManager — on sandbox cleanup, downloads
the remote .hermes/ directory as a tar archive, diffs against SHA-256
hashes of what was originally pushed, and applies only changed files.

- SHA-256 content hashing on push for accurate change detection
- Retry with exponential backoff (3 attempts, 2s/4s/8s)
- SIGINT deferred during sync-back to prevent partial writes
- fcntl.flock serialization for concurrent gateway sandboxes
- Last-write-wins conflict resolution with logged warnings
- New files created on remote are pulled back via path inference
- Backend implementations: SSH (tar cf over pipe), Modal (exec tar
  cf, read stdout), Daytona (exec tar cf, SDK download_file)
- Wired into cleanup() for all three backends (runs before
  ControlMaster close / sandbox terminate / sandbox stop)

28 new tests (10 FSM core + 18 backend-specific), 72 total passing.
2026-04-11 17:56:44 -07:00
..
__init__.py feat(environments): add Daytona cloud sandbox backend 2026-03-05 10:02:21 -08:00
base.py fix: prevent agent from stopping mid-task — compression floor, budget overhaul, activity tracking 2026-04-11 16:18:57 -07:00
daytona.py feat(file-sync): sync remote changes back to host on teardown 2026-04-11 17:56:44 -07:00
docker.py fix(docker): --init for zombie reaping + sleep infinity for idle-based lifetime 2026-04-10 15:42:30 -07:00
file_sync.py feat(file-sync): sync remote changes back to host on teardown 2026-04-11 17:56:44 -07:00
local.py fix: per-profile subprocess HOME isolation (#4426) (#7357) 2026-04-10 13:37:45 -07:00
managed_modal.py feat(environments): unified spawn-per-call execution layer 2026-04-08 17:23:15 -07:00
modal.py feat(file-sync): sync remote changes back to host on teardown 2026-04-11 17:56:44 -07:00
modal_utils.py feat(environments): unified spawn-per-call execution layer 2026-04-08 17:23:15 -07:00
singularity.py feat(environments): unified spawn-per-call execution layer 2026-04-08 17:23:15 -07:00
ssh.py feat(file-sync): sync remote changes back to host on teardown 2026-04-11 17:56:44 -07:00