Skip to content

Close stale VS Code Git repos after worktree cleanup#438

Merged
NagyVikt merged 1 commit intomainfrom
agent/codex/close-vscode-repository-on-worktree-dele-2026-04-27-13-25
Apr 27, 2026
Merged

Close stale VS Code Git repos after worktree cleanup#438
NagyVikt merged 1 commit intomainfrom
agent/codex/close-vscode-repository-on-worktree-dele-2026-04-27-13-25

Conversation

@NagyVikt
Copy link
Copy Markdown
Collaborator

Automated by gx branch finish (PR flow).

The Active Agents refresh loop could keep VS Code's Git SCM pointed at a deleted agent worktree. When a session worktree path no longer exists, the extension now asks Git to close that repository URI and removes a matching workspace folder once, while preserving watcher refresh for live sessions.

This also mirrors finish script/template parity so the metadata gate stays green after remote cleanup warning handling.

Constraint: VS Code Git can keep an already-open repository in SCM after the worktree path is deleted.

Rejected: Rely only on repositoryScanIgnoredFolders | it does not close repositories already opened in SCM.

Confidence: high

Scope-risk: moderate

Directive: Keep vscode/guardex-active-agents and templates/vscode/guardex-active-agents in sync for extension behavior changes.

Tested: node --test test/vscode-active-agents-session-state.test.js

Tested: node --test test/metadata.test.js

Tested: bash -n scripts/agent-branch-finish.sh

Tested: npm test (285 pass, 1 skipped)

Not-tested: Live VS Code window reload behavior after installing the updated extension.
@NagyVikt NagyVikt merged commit 1262fc1 into main Apr 27, 2026
@NagyVikt NagyVikt deleted the agent/codex/close-vscode-repository-on-worktree-dele-2026-04-27-13-25 branch April 27, 2026 11:41
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