Skip to content

feat: label session branches by first message - #449

Merged
agegr merged 2 commits into
agegr:mainfrom
111-test-111:pr/session-tree-branch-labels
Aug 11, 2026
Merged

feat: label session branches by first message#449
agegr merged 2 commits into
agegr:mainfrom
111-test-111:pr/session-tree-branch-labels

Conversation

@111-test-111

@111-test-111 111-test-111 commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

What

Makes in-session branches recognizable in BranchNavigator:

  • Extracts the session-tree projection from app/api/sessions/[id]/route.ts into lib/project-tree.ts
  • Projects a bounded branchPreview from the first message on each compressed branch segment, so the UI can label the branch without retaining that full message node
  • Keeps selection anchored to the compressed branch representative rather than the message used only for its label
  • Supports multi-root trees, including roots that begin with metadata such as model_change or session_info

Payload safety

  • Preview text is normalized and capped at 40 characters
  • Image data, thinking blocks, tool arguments, and unknown role strings are not copied from compressed label-source messages
  • The original root / branch-point / leaf projection shape and compressedEntryIds behavior are preserved

Validation

  • 16 focused projection and navigator tests
  • PR head: 440 tests pass; tsc --noEmit and eslint pass
  • Temporary merge with latest main: 466 tests pass; tsc --noEmit and eslint pass

Notes

This rewrites the inlined projection in app/api/sessions/[id]/route.ts. A companion PR touching the same route imports/response may need a trivial rebase if it lands first.

111-test-111 and others added 2 commits August 9, 2026 23:20
Extract the session-tree projection into lib/project-tree.ts and keep the
first message entry of each diverging arm, so BranchNavigator can label each
branch with the message it diverged with. BranchNavigator renders those
first-message labels and supports multi-root trees.
@agegr
agegr merged commit c87a9a4 into agegr:main Aug 11, 2026
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