You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Isolated worktrees for write-capable /opencode:rescue #34
Write-capable /opencode:rescue tasks currently operate directly in the user's current working tree. This can interleave OpenCode edits with the user's own uncommitted changes or with concurrent Claude Code edits.
There is an existing local issue about a worktree cleanup hang when a Claude subagent is itself isolated in a worktree (#16). This issue is separate: it tracks plugin-managed worktree isolation as a feature for safer write-capable OpenCode tasks.
Motivation
A plugin-managed worktree would help with:
protecting user WIP from OpenCode edits
allowing Claude and OpenCode to work concurrently without racing on the same files
reviewing OpenCode's diff before applying it to the main tree
discarding unwanted OpenCode changes cheaply
Proposed UX
Examples:
/opencode:rescue --worktree fix the failing parser tests
/opencode:rescue --background --worktree implement the migration script
Potential default: use worktree isolation automatically for background write-capable tasks.
Implementation sketch
Create a temporary branch/worktree under a plugin-owned directory.
Run opencode-companion task --write with cwd set to that worktree.
On completion, store the worktree path, branch name, and diff in job data.
Add follow-up commands or result guidance to apply, merge, or discard the changes.
Ensure background workers do not run in Claude-managed worktrees that can be deleted before OpenCode finishes.
changed the title [-]Feature: isolate write-capable /opencode:rescue tasks in git worktrees[/-][+]Isolated worktrees for write-capable /opencode:rescue[/+]on Apr 12, 2026
Consolidating #43 here. The canonical scope is plugin-managed worktree isolation for write-capable rescue tasks, including the --worktree UX and background-safe lifecycle handling.
Fixed by PR #51 commit 23f7fef — --worktree flag creates disposable .worktrees/opencode- on a fresh opencode/ branch; handleTaskWorker parses and forwards it; worktree-cleanup subcommand supports keep/discard with patch preservation on failure.
Activity
[-]Feature: isolate write-capable /opencode:rescue tasks in git worktrees[/-][+]Isolated worktrees for write-capable /opencode:rescue[/+]JohnnyVicious commentedon Apr 12, 2026
Consolidating #43 here. The canonical scope is plugin-managed worktree isolation for write-capable rescue tasks, including the --worktree UX and background-safe lifecycle handling.
JohnnyVicious commentedon Apr 12, 2026
Fixed by PR #51 commit 23f7fef — --worktree flag creates disposable .worktrees/opencode- on a fresh opencode/ branch; handleTaskWorker parses and forwards it; worktree-cleanup subcommand supports keep/discard with patch preservation on failure.