Conversation
…ion independence Instead of storing home-relative transcript paths in checkpoint metadata, always compute paths from the current repository location at restore time using agent.GetSessionDir(repoRoot). This makes resume portable across machine moves and directory changes. ## Changes 1. **Remove SessionTranscriptPath writes** (manual_commit_condensation.go) - Stop embedding sanitized repo path in checkpoint metadata 2. **Update RestoreLogsOnly()** (manual_commit_rewind.go) - Always compute transcript path from current repo location - Remove resolveTranscriptPathFromMetadata() helper (now unused) - Apply same fix to classifySessionsForRestore() 3. **Add deprecation comments** (checkpoint.go) - Mark TranscriptPath fields as DEPRECATED - Keep for backward compatibility with old checkpoints - Document new computation approach 4. **Add E2E test** (resume_relocated_repo_test.go) - Verify resume works after repo relocation - Ensure transcript restores to NEW location, not stored old location ## Why This Works - **Location-independent**: agent.GetSessionDir() uses current repo path - **Cross-machine portable**: No stored paths embedded in metadata - **Backward compatible**: Old checkpoints with transcript_path still work - **Simpler**: Removes fallback logic, always uses computed paths Fixes issue where resume failed when projects moved directories or were cloned to different machines with different absolute paths. Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com> Entire-Checkpoint: c8200a737b62
PR SummaryCursor Bugbot is generating a summary for commit 19129c2. Configure here. |
There was a problem hiding this comment.
Pull request overview
This PR fixes issue #402 where entire resume fails to restore sessions when a repository is moved to a different location. The root cause was that session restoration was using stored absolute paths from checkpoint metadata and .git/entire-sessions/ state files, which become stale when repos are relocated.
Changes:
- Session restoration now computes transcript paths from current repo location instead of using stored metadata paths
- Deprecated
TranscriptPathfield in checkpoint metadata (kept for backward compatibility but no longer written or read) - Fixed Gemini agent to use SHA256 hash of project path (matching actual Gemini CLI behavior) instead of incorrect path sanitization
- Added comprehensive E2E test verifying resume works after repo relocation
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
cmd/entire/cli/strategy/manual_commit_rewind.go |
Changed RestoreLogsOnly and classifySessionsForRestore to compute transcript paths using agent.ResolveSessionFile directly instead of reading from metadata |
cmd/entire/cli/strategy/manual_commit_condensation.go |
Removed writing of deprecated SessionTranscriptPath field when creating checkpoints |
cmd/entire/cli/strategy/common.go |
Removed unused homeRelativePath helper function |
cmd/entire/cli/checkpoint/checkpoint.go |
Marked SessionTranscriptPath and TranscriptPath fields as deprecated with documentation |
cmd/entire/cli/agent/geminicli/gemini.go |
Fixed GetSessionDir to use SHA256 hash (GetProjectHash) matching Gemini CLI's actual behavior; updated fallback in ResolveSessionFile to generate proper Gemini-style filenames |
cmd/entire/cli/agent/geminicli/gemini_test.go |
Updated tests to verify new GetProjectHash function and Gemini-style fallback filenames |
cmd/entire/cli/e2e_test/resume_relocated_repo_test.go |
New E2E test verifying resume works correctly after repository relocation |
19129c2 to
80ddc0a
Compare
|
bugbot run |
Code reviewFound 2 issues:
Lines 731 to 745 in cb05100 The PR's own comment at lines 707-711 of cli/cmd/entire/cli/strategy/manual_commit_rewind.go Lines 707 to 717 in cb05100
cli/cmd/entire/cli/strategy/manual_commit_rewind.go Lines 777 to 788 in cb05100 🤖 Generated with Claude Code - If this code review was useful, please react with 👍. Otherwise, react with 👎. |
fixes: #402