@@ -4,36 +4,66 @@ All notable changes to this project are documented here. The format is based on
44[ Keep a Changelog] ( https://keepachangelog.com/ ) , and the project aims to follow
55[ Semantic Versioning] ( https://semver.org/ ) .
66
7- ## [ Unreleased]
7+ ## [ 0.2.0] - 2026-06-16
8+
9+ The "agent rolls back itself" release: an agent can now explore, undo, and
10+ continue — from inside one running session — and prune dead ends, all via its
11+ own MCP tools, while still capturing system-level changes.
812
913### Added
10- - ** Interactive ` supervise ` ** : when stdin is a TTY, ` agentenv supervise -- <agent> `
11- now runs the agent on a PTY (so an interactive REPL like Claude Code works)
12- while still serving the control socket. A rollback issued from another
13- terminal (` agentenv ctl checkout <id> ` ) kills the agent and relaunches it
14- from the restored environment — you never have to exit it. Without a TTY it
15- keeps the previous headless (backgrounded + log-tail) behavior, so the same
16- command covers both interactive and long-running autonomous agents.
17- - ` agentenv shell -- <cmd> ` runs an arbitrary program inside the sandbox on a
18- PTY (defaults to a login shell).
19- - ` AGENTENV_FORWARD=NAME,NAME,PREFIX_* ` forwards named env vars (trailing ` * `
20- wildcard) into the sandbox by value-at-call-time — complementing the existing
21- ` AGENTENV_PASS_<VAR>=val ` form. A wrapper image can bake
22- ` ENV AGENTENV_FORWARD=ANTHROPIC_*,CLAUDE_* ` so users just pass
23- ` -e ANTHROPIC_API_KEY=... ` .
24- - ` init --from ` prints throttled copy progress (files + bytes) and a final
25- summary; a multi-GB seed no longer looks like a hang.
14+ - ** ` supervise --self-rollback ` ** : the agent rolls back its OWN environment
15+ (via the ` agentenv__checkout ` MCP tool / ` ctl checkout ` ) and KEEPS RUNNING.
16+ The control socket lives inside the sandbox (`work/current/.agentenv/
17+ control.sock`, an always-ignored dir) so the agent can reach the daemon from
18+ within the env; a checkout reverts the rootfs in place WITHOUT killing the
19+ agent. Survival works because the in-place sync only touches changed files —
20+ the agent's own runtime is unchanged across a session's snapshots.
21+ - ** Interactive ` supervise ` ** : with a TTY, runs the agent on a PTY (interactive
22+ REPLs like Claude Code work) while serving the control socket; without a TTY
23+ it stays headless (backgrounded + log-tail) for autonomous agents. One
24+ command covers both. Interactive mode is silent (no banner) so it doesn't
25+ pollute the agent's terminal.
26+ - ** Delete a node** : ` agentenv delete <node> ` (+ ` ctl delete ` , + the
27+ ` agentenv__delete ` MCP tool). Splices the node out, re-parenting its children
28+ to its parent so descendants survive; refuses to delete HEAD or the only
29+ node. Safe even when children hardlink-share its files.
30+ - ** Auto-route to a running session** : a lock-taking command (checkout / commit
31+ / delete / exec / tag / gc / tournament) that can't get the repo lock because
32+ a daemon/supervise holds it is transparently routed through that session's
33+ control socket — so ` agentenv checkout <id> ` just works whether or not a
34+ daemon is up.
35+ - ` agentenv shell -- <cmd> ` runs an arbitrary program inside the sandbox on a PTY.
36+ - ` AGENTENV_FORWARD=NAME,PREFIX_* ` forwards named env vars into the sandbox by
37+ value-at-call-time (complements ` AGENTENV_PASS_<VAR>=val ` ). Wrapper images
38+ bake ` ENV AGENTENV_FORWARD=ANTHROPIC_*,CLAUDE_* ` so users just pass ` -e ... ` .
39+ - ` init --from ` prints throttled copy progress + a final summary.
2640- ` Dockerfile.control ` gains ` --build-arg SEED_AT_BUILD=1 ` to bake the managed
27- rootfs into the image at build time (cached layer) instead of seeding on
28- first run. Build-time seeding also can't capture runtime-mounted K8s secrets.
41+ rootfs at build time (cached layer, instant start; also can't capture
42+ runtime-mounted K8s secrets) .
2943- ` examples/claude-code/ ` : a ready-to-use rewindable Claude Code image —
30- ` docker run -it ` lands you in the sandbox shell, start ` claude ` yourself,
31- every change auto-snapshotted, rewind with ` agentenv checkout ` .
32- - Release pipeline pushes multi-arch container images to
33- ` ghcr.io/css521/agentenv:<tag> ` + ` :latest ` (goreleaser ` dockers ` ).
34- - ` .devcontainer/ ` : bumped to a Go 1.26 image, dropped the redundant
35- common-utils feature, and added an opt-in ` AGENTENV_CN_MIRROR=1 ` apt mirror
36- for slow networks. ` .dockerignore ` keeps the build context small.
44+ ` docker run -it ` , start ` claude ` , every change auto-snapshotted, and Claude
45+ can roll back / prune its own history via MCP. Published to
46+ ` ghcr.io/css521/rewindable-claude ` .
47+ - Release pipeline pushes multi-arch images for both the agentenv binary
48+ (` ghcr.io/css521/agentenv ` ) and the Claude Code env
49+ (` ghcr.io/css521/rewindable-claude ` ).
50+ - ` .devcontainer/ ` : Go 1.26 image, opt-in ` AGENTENV_CN_MIRROR=1 ` apt mirror.
51+ ` .dockerignore ` keeps the build context small.
52+
53+ ### Changed
54+ - Snapshot ignore overhaul: glob/segment patterns matched at any path depth
55+ (` .claude* ` , ` *.tmp.* ` ), sensible built-in defaults (agent state + caches +
56+ atomic temp files), ` AGENTENV_IGNORE ` now EXTENDS rather than replaces, and a
57+ set of always-ignored runtime paths. Empty-change snapshots are skipped. Net
58+ effect: the DAG shows only real work, not the agent's bookkeeping churn.
59+ - ` agentenv status ` reports the backend's actual ignore patterns.
60+
61+ ### Fixed
62+ - ` agentenv ctl exec ` propagates the inner command's exit code (was always 0).
63+ - Cross-uid daemon-socket connect reports both uids + a hint; daemon/headless
64+ supervise log their uid on startup.
65+ - apt works inside the rootless sandbox (` examples/claude-code ` bakes
66+ ` APT::Sandbox::User "root" ` — userns forbids apt's setgroups privilege-drop).
3767
3868## [ 0.1.1] - 2026-06-16
3969
@@ -149,6 +179,6 @@ drive rollback natively.
149179 incremental checkout (copy only the diff); ` AGENTENV_IGNORE ` excludes ephemeral
150180 paths; auto-snapshot labels list the changed files.
151181
152- [ Unreleased ] : https://github.com/css521/agentenv/compare/ v0.1.1...HEAD
182+ [ 0.2.0 ] : https://github.com/css521/agentenv/releases/tag/ v0.2.0
153183[ 0.1.1 ] : https://github.com/css521/agentenv/releases/tag/v0.1.1
154184[ 0.1.0 ] : https://github.com/css521/agentenv/releases/tag/v0.1.0
0 commit comments