feat: Session Lineage — related plans from the same agent session#167
Merged
Conversation
Surface same-session peers, parent/child thread links, and soft workspace fallbacks in the plan viewer, with a quiet session marker on list rows that share a sessionId. Co-authored-by: Tyrus Malmström <tyrusM@hotmail.com>
Tyru5
marked this pull request as ready for review
July 18, 2026 00:32
Contributor
Confidence Score: 5/5Safe to merge; both previously flagged issues (agent scoping and session peer cap) are addressed in this version. The new plan-lineage.ts module is well-tested and the agent-scoped session peer lookup is correctly capped at 8 entries. The two remaining notes are non-blocking quality concerns. The parent/child loops in plan-lineage.ts (lines 164–182) are the only area worth a second look. Reviews (2): Last reviewed commit: "fix: align session lineage peers with li..." | Re-trigger Greptile |
Require same agent for session/thread peers and cap related peers around the current plan so the viewer stays consistent with the list badge and cannot grow unbounded. Co-authored-by: Tyrus Malmström <tyrusM@hotmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds Session Lineage so opening a plan shows other plans from the same agent session (and parent/child thread links when
parentThreadIdis present), using metadata adapters already index.Changes
plan-lineagehelper: groups byagent+sessionId, links viaparentThreadId, soft fallback to same agent + workspace + branch/daysessionmarker on plan list rows that share asessionIdwith the same agentReview follow-ups
${agent}\\0${sessionId})Test plan
bun test packages/web/src/client/lib/plan-lineage.test.tsbun run lint(0 errors)bun run fmt:checksessionon sibling rows; viewer shows Same session timeline; click navigates between Alpha/BetaDemo
Plan list session labels
Plan viewer Same session section
To show artifacts inline, enable in settings.