Skip to content

Keep local main pull-only by automatically cleaning finished agent worktrees#33

Merged
NagyVikt merged 1 commit intomainfrom
agent/codex/20260411-191858-info-recodee-com-auto-cleanup-agent-worktrees-and-pull-only-main
Apr 11, 2026
Merged

Keep local main pull-only by automatically cleaning finished agent worktrees#33
NagyVikt merged 1 commit intomainfrom
agent/codex/20260411-191858-info-recodee-com-auto-cleanup-agent-worktrees-and-pull-only-main

Conversation

@NagyVikt
Copy link
Copy Markdown
Collaborator

Automated by scripts/agent-branch-finish.sh (PR flow).

…rktrees

Stale agent worktrees were piling up in VS Code Source Control, and manual cleanup
required passing hardcoded base arguments. This change makes cleanup default and safer:
`agent:cleanup` now uses base auto-detection, prune can preserve dirty worktrees unless
explicitly forced, and codex-agent triggers post-session prune automatically.

Tests now cover clean-sandbox auto-prune and dirty-sandbox preservation paths so the
workflow stays predictable while reducing branch/worktree clutter.

Constraint: Cleanup must not delete in-progress work by default
Rejected: Always force-delete dirty worktrees after codex exit | risks losing active edits
Confidence: high
Scope-risk: moderate
Reversibility: clean
Directive: If prune rules change, keep codex-agent post-session behavior and dirty-preservation tests aligned
Tested: npm test (54/54); node --check bin/multiagent-safety.js
Not-tested: End-to-end codex-agent run against real Codex CLI interactive session
@NagyVikt NagyVikt merged commit fc70c5f into main Apr 11, 2026
7 checks passed
@NagyVikt NagyVikt deleted the agent/codex/20260411-191858-info-recodee-com-auto-cleanup-agent-worktrees-and-pull-only-main branch April 11, 2026 17:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant