fix(server): fall back to local worktree base when origin fails #7667
Closedsaphid(GitHub profile, opens in a new tab)wants to merge 4 commits into
main fromrefs/pull/7667/headopened View on GitHubgithub-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:trusted
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:L
saphid(GitHub profile, opens in a new tab) changed the title
github-actions[bot](GitHub profile, opens in a new tab) removed labelssize:L
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:M
- apps/server/src/ws.ts lines 1043 to 1047OutdatedResolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -1039,0 +1027,21 @@1027+ });1028+ if (!originAvailable) {1029+ return prepareWorktree.baseBranch;1030+ }1031+ yield* gitWorkflow.fetchRemote({1032+ cwd: prepareWorktree.projectCwd,1033+ remoteName: "origin",1034+ });1035+ const resolvedRemoteBase = yield* gitWorkflow.resolveRemoteTrackingCommit({1036+ cwd: prepareWorktree.projectCwd,1037+ refName: prepareWorktree.baseBranch,1038+ fallbackRemoteName: "origin",1039+ });1040+ return resolvedRemoteBase.commitSha;1041+ }).pipe(1042+ Effect.catch((error) =>1043+ Effect.logWarning("could not prepare worktree base from origin", {1044+ threadId: command.threadId,1045+ baseBranch: prepareWorktree.baseBranch,1046+ remoteName: "origin",1047+ detail: error.message,
github-actions[bot](GitHub profile, opens in a new tab) removed labelssize:M
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:S
juliusmarminge added labelsmacroscope-review
macroscopeapp[bot](GitHub profile, opens in a new tab) approved these changes
juliusmarminge closed this
Sign in to join this conversation.
Note
Reviews paused#
It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the
reviews.auto_review.auto_pause_after_reviewed_commitssetting.Use the following commands to manage reviews:
@coderabbitai resumeto resume automatic reviews.@coderabbitai reviewto trigger a single review.Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. 🎉
ℹ️ Recent review info
⚙️ Run configuration
Configuration used: Repository: pingdotgg/t3code/.coderabbit.yaml
Review profile: CHILL
Plan: Advanced
Run ID:
80159a0d-f51f-4fad-9a62-398a63957ea4📥 Commits
Reviewing files that changed from the base of the PR and between ea42f3e2cc23b59b6af81c702568cfdf9066ad6a and ffe07247272976857e227ff1f6049177af6dfc1a.
📒 Files selected for processing (2)
apps/server/src/server.test.tsapps/server/src/ws.tsLimit details: You’ve used all 10 included reviews currently available.
📝 Walkthrough
Walkthrough#
The bootstrap flow catches failures during origin-based worktree preparation and falls back to the local base branch. Tests cover six failure stages, non-default branches, Git operation counts, worktree references, and thread deletion behavior.
Changes#
Bootstrap fallback
apps/server/src/ws.tsbaseBranch.apps/server/src/server.test.tspersonal/test, checks worktree references, confirms successful turn dispatch, and verifies that nothread.deletecommand is emitted.Priority: ⬇️ Low
Estimated code review effort: 3 (Moderate) | ~20 minutes
Change: Bug fix
Suggested reviewers:
t3dotgg,juliusmarminge🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
✨ Finishing Touches
🧪 Generate unit tests (beta)
Comment `@coderabbitai help` to get the list of available commands.