Repository navigation
Conversation
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository: pingdotgg/t3code/.coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (1)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 3 remain after this review. 📝 WalkthroughWalkthrough
ChangesPairing discovery
Priority: ⬇️ Low Estimated code review effort: 2 (Simple) | ~15 minutes Change: Bug fix Suggested reviewers: Merge Risk: ⚪ Minimal · up to Linked-worktree pairing now reports missing or stale local server state instead of using a shared server; explicit-base and ordinary-checkout discovery remain supported. No actionable merge risk is apparent. Architecture SummaryArchitecture risk: 🔵 Low · up to The change affects 1 system. Changed systems: Architecture concerns Review detailsSystems and components
Before / after behavior
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
ApprovabilityVerdict: Not approved Macroscope's review found this PR not approvable — This focused fix correctly prevents linked worktrees from falling back to the shared installation and adds regression coverage for the discovery cases. Because the selected installation is also where pairing credentials are minted and persisted, the runtime change has authentication-sensitive impact that warrants human review. You can add or adjust custom eligibility rules. Learn more. |
9c32b39 to
3711cf5
Compare
Problem
Running
t3 pairfrom a linked worktree with no live local server silently selected the shared install and opened its database with the checkout's migrations. That can migrate the live desktop database from a dev checkout.Change
Discovery now checks only the worktree's
.t3when run inside a linked worktree, matching dev-runner precedence (worktreeHome ?? shared home). A missing or stale local server returnsNoRunningServerError. An explicit--base-dirand discovery outside linked worktrees still work.This does not repair already affected databases. Minting still uses
EnvironmentAuth.runtimeLayer, so preventing checkout migrations when a database is explicitly targeted (includingauth pairing create) remains a follow-up.Scope and approval
Fixes #10516. Maintainer triage confirmed the bug and identified the inclusive discovery fallback as the cause: #10516 (comment)
Verification
state.sqlitein the shared home.apps/server/src/cli/pair.test.tscovers missing, stale, local, explicit--base-dir, and ordinary-checkout discovery, and asserts no shared database is created for the worktree cases. The missing and stale cases fail without the fix.main(only conflict:Config.stringrenamed toConfig.String):vp test run src/cli/pair.test.tsinapps/server, 15 of 15 passed.vp lintandvp fmt --checkon both changed files: clean.tsc --noEmitforapps/server: no errors.Original change by GPT-6 via Codex. Rebase and description update by Claude Opus 5.5 via Claude Code.
Note
Fix worktree pairing fallback to live T3CODE_HOME install
Adds a parameterized discovery test in pair.test.ts covering missing, stale, local, explicit-base, and regular-checkout worktree scenarios. The test creates temporary worktree and shared-home layouts, mocks the working directory, and verifies which state database and pairing output are used. Confirms that linked worktrees no longer fall back to the shared T3CODE_HOME installation, while local worktree state, explicit base directories, and regular checkouts still produce pairing URLs.
Macroscope summarized 9c32b39.
Summary by CodeRabbit
t3 pairdiscovery in linked Git worktrees..t3directory and no longer falls back to the shared T3 home directory when operating there.