Skip to content

feat: fall back to origin/entire/sessions when local branch missing#139

Merged
khaong merged 4 commits intomainfrom
alex/improve-explain
Feb 4, 2026
Merged

feat: fall back to origin/entire/sessions when local branch missing#139
khaong merged 4 commits intomainfrom
alex/improve-explain

Conversation

@khaong
Copy link
Contributor

@khaong khaong commented Feb 3, 2026

Summary

  • After a fresh git clone, entire/sessions only exists as a remote-tracking branch (origin/entire/sessions), not as a local branch
  • entire explain was showing no checkpoints because getSessionsBranchTree() only checked the local branch
  • Now falls back to origin/entire/sessions when the local branch doesn't exist

Test Plan

  • Added TestListCommitted_FallsBackToRemote test that simulates post-clone state
  • All existing tests pass
  • Lint passes

🤖 Generated with Claude Code


Note

Low Risk
Low risk: small, targeted change to checkpoint listing/reading that only affects repos where entire/sessions isn’t checked out locally; covered by a new integration-style test simulating post-clone state.

Overview
Fixes post-clone checkpoint discovery by updating getSessionsBranchTree() to fall back from the local entire/sessions branch to the remote-tracking origin/entire/sessions ref when the local branch doesn’t exist.

Adds TestListCommitted_FallsBackToRemote, which creates a remote repo with a committed checkpoint, clones it without creating the local sessions branch, fetches origin/entire/sessions, and asserts ListCommitted() still returns the checkpoint.

Written by Cursor Bugbot for commit e01f873. This will update automatically on new commits. Configure here.

khaong and others added 2 commits February 3, 2026 16:50
Add TestListCommitted_FallsBackToRemote which verifies that ListCommitted
can find checkpoints when only origin/entire/sessions exists (simulating
post-clone state). This test currently fails because getSessionsBranchTree
only checks for the local branch refs/heads/entire/sessions and doesn't
fall back to the remote-tracking branch refs/remotes/origin/entire/sessions.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Entire-Checkpoint: a7f087274d3b
After a fresh clone, entire/sessions only exists as a remote-tracking branch
(origin/entire/sessions). This change makes getSessionsBranchTree() check
the remote-tracking branch when the local branch doesn't exist, allowing
'entire explain' to show checkpoints without manual fetch.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Entire-Checkpoint: af83563936ee
Copilot AI review requested due to automatic review settings February 3, 2026 06:31
@khaong khaong marked this pull request as ready for review February 4, 2026 00:39
@khaong khaong requested a review from a team as a code owner February 4, 2026 00:39
@khaong khaong enabled auto-merge February 4, 2026 00:39
@khaong khaong merged commit 975805a into main Feb 4, 2026
4 checks passed
@khaong khaong deleted the alex/improve-explain branch February 4, 2026 04:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants