Skip to content

feat: Session Lineage — related plans from the same agent session#167

Merged
Tyru5 merged 2 commits into
mainfrom
cursor/session-lineage-8dd1
Jul 18, 2026
Merged

feat: Session Lineage — related plans from the same agent session#167
Tyru5 merged 2 commits into
mainfrom
cursor/session-lineage-8dd1

Conversation

@Tyru5

@Tyru5 Tyru5 commented Jul 17, 2026

Copy link
Copy Markdown
Owner

Summary

Adds Session Lineage so opening a plan shows other plans from the same agent session (and parent/child thread links when parentThreadId is present), using metadata adapters already index.

Changes

  • New plan-lineage helper: groups by agent + sessionId, links via parentThreadId, soft fallback to same agent + workspace + branch/day
  • Plan viewer Same session / Session thread / Nearby in workspace timeline with click-to-navigate
  • Quiet session marker on plan list rows that share a sessionId with the same agent
  • Caps related peers at 8 around the current plan (avoids unbounded session timelines)
  • Wired through OSS and EE dashboards (including split view / Plannotator review)

Review follow-ups

  • Matched viewer peer lookup to list badge agent-scoping (${agent}\\0${sessionId})
  • Added peer cap with a window centered on the current plan

Test plan

  • bun test packages/web/src/client/lib/plan-lineage.test.ts
  • bun run lint (0 errors)
  • bun run fmt:check
  • Manual OSS: list shows session on sibling rows; viewer shows Same session timeline; click navigates between Alpha/Beta

Demo

Plan list session labels

Plan viewer Same session section

To show artifacts inline, enable in settings.

Open in Web Open in Cursor 

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
Tyru5 marked this pull request as ready for review July 18, 2026 00:32
@greptile-apps

greptile-apps Bot commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

Confidence Score: 5/5

Safe 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

Comment thread packages/web/src/client/lib/plan-lineage.ts
Comment thread packages/web/src/client/lib/plan-lineage.ts
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>
@Tyru5
Tyru5 merged commit 3eacd3c into main Jul 18, 2026
4 checks passed
@Tyru5
Tyru5 deleted the cursor/session-lineage-8dd1 branch July 18, 2026 01:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants