v0.9.1
Critical Fix: Branch Preservation Before Session Abort
session.abort() triggers OpenCode's internal worktree cleanup, which may asynchronously delete the git branch. In v0.9.0 and earlier, agent work was silently lost on shutdown — the branch was destroyed before it could be merged.
Every code path that calls session.abort() now preserves the branch first. The worktree branch is copied to ensemble/preserved/{team}/{name} — a standalone git ref that OpenCode cannot delete.
New Tool: team_merge
Explicit per-agent branch merging. After shutting down a teammate, call team_merge to squash-merge their preserved branch into your working directory as unstaged changes.
team_shutdown("alice") → branch preserved to ensemble/preserved/team/alice
team_merge("alice") → changes land unstaged, review with git diff
team_cleanup → safety-net merges any forgotten branches
All session.abort() Call Sites Covered
| Call site | Protection |
|---|---|
team_shutdown (idle/force) |
preserveAndAbort() |
team_shutdown (graceful) |
Preserves before sending shutdown message |
team_cleanup (force) |
Preserves before aborting active members |
| Crash recovery | Preserves before aborting stale busy members |
| Watchdog timeout | Preserves before aborting timed-out members |
busy_while_shutdown event |
Verifies/re-preserves before re-abort |
Also in this release
gitStashPopchecks exit code, falls back to plainpop, warns on failure- Orphaned
ensemble/preserved/*branches cleaned up on startup - 20 new tests covering the full merge lifecycle
- AGENTS.md documents branch preservation as settled decision #12
Full Changelog: v0.9.0...v0.9.1