Fix /resume flooding with sub-run sessions - #169
Conversation
The /resume picker called sessions.Store.List() unfiltered, so it showed every session directory — including the child (specialist/sub-agent) and spec draft/impl sessions an agent spawns by the dozen per conversation. That flooded the picker (the reported '… 779 more · /resume <id>') even though the TUI creates exactly one session per conversation. Add Store.ListResumable()/LatestResumable() (and an IsResumableKind predicate) that keep only regular and user-fork sessions, and use them for the picker and for '/resume latest' so latest never lands on a newer child/spec sub-run. An explicit '/resume <id>' still resolves any session by id. Covered by TestListAndLatestResumableExcludeSubRuns and TestResumePickerExcludesSubRunSessions.
Zero automated PR reviewVerdict: No blockers found Blockers
Validation
ScopeHead: This deterministic review checks validation status and basic diff hygiene. A human reviewer still owns product judgment and design quality. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (5)
WalkthroughThe PR adds resumable-session filtering to prevent child runs and spec drafts from cluttering the ChangesResume session filtering by kind
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
Vasanthdev2004
left a comment
There was a problem hiding this comment.
Approved. Cross-checked this against the D session flow and the direction matches: normal resume/latest should only surface user-resumable top-level conversations, while explicit resume by id still works. Local validation passed with go test ./internal/sessions ./internal/tui and go test ./.... No blockers from my side.
Problem
/resumeshowed a session list ending in "… 779 more · /resume " — far more sessions than real conversations. Root cause: the picker calledsessions.Store.List()unfiltered, so it listed every session directory, including the child (specialist/sub-agent) and spec-draft/spec-impl sessions an agent spawns by the dozen. The TUI itself creates exactly one session per conversation (ensureActiveSessionguards on the active id and appends events), so the flood was entirely the unfiltered listing.Fix
sessions.IsResumableKind,Store.ListResumable(), andStore.LatestResumable()— they keep only standalone conversations (regular + user forks) and dropchild/spec-draft/spec-implsub-runs./resumepicker usesListResumable(); the "N more" count is now honest./resume latestusesLatestResumable()so it never lands on a newer child/spec sub-run./resume <id>is unchanged — an explicit id still resolves any session.Tests
TestListAndLatestResumableExcludeSubRuns— store-level: only regular+fork listed; latest skips a newer child.TestResumePickerExcludesSubRunSessions— TUI picker lists the real conversation, excludes child/spec.go build, fullgo test ./...,go vet,gofmtall clean.Summary by CodeRabbit