Skip to content

Releases: earneet/opencode-worktree-isolation

v0.4.3

Choose a tag to compare

@earneet earneet released this 16 Sep 10:00
f695f48

Fixes (issue #7 follow-up)

Fixes the follow-up reported in #7 (comment): v0.4.2's zombie-binding fix did not cover the main path of "background task sub-sessions completing normally" — worktree_merge apply was blocked 100% by inherited: true bindings of finished sub-agents.

Inherited sub-agent bindings now have a full lifecycle

  • Event-driven release (root fix): new event hook — session.idle releases a sub-agent's inherited binding the moment its task finishes; session.deleted releases any binding. Audited as binding_released. If a released sub-agent resumes later, lazy parent-chain inheritance re-binds it transparently (self-healing).
  • Guard semantics corrected: merge/cleanup now refuse only when an independent session holds a binding for the worktree. Inherited bindings are, by construction, descendants of the owner session — they are released along with the worktree instead of blocking it.
  • Cascade clearing: after a worktree is removed (merge/cleanup) or detected missing, every binding pointing at it is cleared, including the in-process inheritance cache — finished background tasks can never leave residue in the state file, across restarts.

Cleanup preview / merged-detection fixes

  • git branch --merged prefixes linked-worktree branches with +; the old parser only stripped *, so every managed worktree was labeled unmerged and non-force worktree_cleanup apply always skipped them. Both markers are now stripped (lookahead-guarded so +foo-style branch names stay intact); detached-HEAD pseudo entries are skipped.
  • worktree_cleanup(action="preview") aggregates per worktree (sessions=N, no duplicate lines) and reaps bindings whose directories are gone.
  • The apply loop processes each worktree exactly once, driven by its direct binding (correct for both external and git-common state backends).

Full changelog: v0.4.2...v0.4.3

v0.4.2

Choose a tag to compare

@earneet earneet released this 10 Sep 03:45

Fixes (issue #7)

Windows: worktree removal 100% failure (Filename too long)

  • git worktree remove now has a fallback chain: on Windows, robocopy <empty> <worktree> /MIR (long-path-capable) + rmSync; on POSIX, fs.rmSync with retries
  • Fallback success → worktree prune + branch deletion + unbind continue; no more manual robocopy ritual after every merge in bun monorepos
  • If both deletion paths fail, the error message spells out the exact manual recovery commands and the still-bound state

Zombie session bindings

  • Bindings whose worktree directory no longer exists now auto-expire on the next tool call: auto-unbind + binding_expired audit entry + warning — read/write/edit immediately fall back to the repo root instead of rewriting into a dead path
  • worktree_cleanup handles already-missing worktrees directly (prune + delete branch + unbind)

Improvements

  • worktree_merge(action="preview") lists the files that will be auto-committed (up to 20)

Full changelog: v0.4.1...v0.4.2

v0.4.1

Choose a tag to compare

@earneet earneet released this 09 Sep 07:54
26907eb

Fix

  • .git\ path check now uses path-segment matching — .github/, .gitignore, .gitattributes, .gitmodules\ are no longer mistaken for the .git\ directory and wrongly blocked (
    ead/\write/\edit\ deny, \glob/\grep\ throw, allow-list rejection, skipped worktree rewrite)
  • New \isDotGitPath(): .git\ must be a complete path segment (ends with /.git\ or contains /.git/); real .git\ blocking behavior unchanged
  • 7 new regression tests; full suite 177/177 pass on Windows/Linux/macOS

Full changelog: v0.4.0...v0.4.1

v0.4.0

Choose a tag to compare

@earneet earneet released this 09 Sep 07:39
f997c81

What's New

Multi-session safety + strict modes (borrowed from zcode-worktree-guard)

  • *\strictWrites* — block Write/Edit to the main checkout without an active worktree binding
  • *\strictGitOps* — block \git push/merge/rebase/pull/checkout/branch -d\ on protected branches (\master/\main\ always protected)
  • *\mainWriteWhitelist* — permanent glob whitelist for repo-level config/docs writes
  • *\worktree_allow* tool — temporary per-call escape hatch with TTL + audit log
  • Subagent inheritance — \ ask()\ subagents inherit the parent session's worktree binding
  • Dangling-reference guards: cleanup/merge refuse to delete worktrees still bound by other sessions

Fixes

  • Cross-platform CI: Linux + macOS added to test matrix (#1, #2)

  • orm()\ cross-separator path matching on POSIX (#5)

Full changelog: v0.3.1...v0.4.0