fix: persist WorkspaceRepoPath in metadata to avoid projectRepoResolver on cleanup (#2608)#2679
Open
Pulkit7070 wants to merge 1 commit into
Open
fix: persist WorkspaceRepoPath in metadata to avoid projectRepoResolver on cleanup (#2608)#2679Pulkit7070 wants to merge 1 commit into
Pulkit7070 wants to merge 1 commit into
Conversation
…er on cleanup (#2608) - Add WorkspaceRepoPath field to SessionMetadata so the repo path is stored at spawn/restore time and survives project archival. - Populate WorkspaceRepoPath in both spawn and restore metadata literals. - Return RepoPath from workspaceInfo() so the gitworktree adapter takes the fast path (info.RepoPath != "") and bypasses projectRepoResolver for archived projects during cleanup. - Expand cleanupSkipReason() with an ErrProjectNotResolvable case that surfaces a clear user-facing message instead of the generic fallback. - Add --dry-run flag to `ao session cleanup` to preview which sessions would be removed without actually removing anything. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Collaborator
Author
|
@iamasx — this one's ready for review when you get a chance 🙏 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this does
Persists the workspace repo path (
WorkspaceRepoPath) in a session's stored metadata so project/session teardown can locate and reclaim the session's worktree without having to re-resolve the project.Problem
Cleanup relied on
projectRepoResolverto find a session's worktree at teardown time. For archived (or otherwise stale) projects that lookup could fail, so cleanup couldn't reclaim the worktree — leaving orphaned worktrees on disk. Closes #2608.Changes
backend/internal/domain/session.go— addWorkspaceRepoPathto session metadata.backend/internal/session_manager/manager.go— populate it on spawn and use it during cleanup instead of depending on the resolver.backend/internal/cli/session.go— plumb/surface the field where needed.Testing
🤖 Generated with Claude Code