fix: reconcile backend id only from an unambiguous transcript dir - #103
Conversation
A live `aimux repair` exposed a real mis-binding: sessions without a worktreePath fell back to the main-repo transcript directory, which holds many transcripts from agents that ran there over time. The "most recently active" heuristic then bound several offline sessions to the SAME id (the latest main-repo transcript) — a duplicate, wrong binding. The original resume path deliberately refused to guess; the discovery heuristic broke that. Bind only when the worktree's transcript directory holds exactly one candidate. Absent, empty, or multi-transcript directories refuse (null). This keeps every correct single-transcript recovery (the worktree agents) and eliminates wrong/duplicate bindings by construction. Disambiguating a multi-transcript dir by session createdAt is left as a future enhancement. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughThe PR refactors transcript discovery to refuse ambiguity instead of guessing: ChangesBackend session discovery refactoring
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
Found in production
Running the W3
aimux repairon a real project surfaced a mis-binding the W2 audit had flagged as a theoretical risk — and it was real. Offline sessions without a worktreePath fell back to the main-repo transcript directory, which accumulates many transcripts from agents that ran there over time. The "most recently active" tie-break then bound several offline sessions to the same id (the latest main-repo transcript):The original resume path deliberately refused to guess; the discovery heuristic broke that guarantee.
Fix
Bind only when the worktree's transcript directory holds exactly one candidate. Absent / empty / multi-transcript directories refuse (
null). This:claude-omdtnpthat started this work),Disambiguating a multi-transcript dir by session
createdAtis noted as a future enhancement.Verification
yarn verifygreen: typecheck + lint clean, 1027/1027 tests.Follow-up to #100 / #101.
🤖 Generated with Claude Code
Summary by CodeRabbit
Bug Fixes
Tests