Enrich fork-point and branch nav labels with message summaries#212
Enrich fork-point and branch nav labels with message summaries#212cboos wants to merge 1 commit into
Conversation
…follow-up)
Fork points and branches whose anchor message isn't user/assistant text rendered
with an empty preview ("Fork point (2 branches)" / "Branch • <uuid8>"), making
the fork structure hard to follow. Give them a type-aware label:
- Fork point on a tool_use / thinking message → "Fork point • Bash — <desc>" /
"… • Thinking" (extends _fork_point_preview, which previously returned "" for
any non-text content).
- Branch whose first message has no user text → fall back to a type-aware
summary of its first meaningful message ("Bash — <desc>" / "Thinking"),
while still preferring the branch-local user text when present (preserves the
/exit "No response requested." case and the spawned-agent prompt exclusion).
Adds _tool_summary_label + _entry_nav_summary helpers. Pure labeling — no change
to fork detection (that's the follow-up). Tests cover the helpers + the
tool_use/thinking fork-point and branch cases.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
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 (2)
📝 WalkthroughWalkthroughThis PR enhances transcript navigation labels in the renderer by introducing type-aware summary generation. New helper functions ChangesType-aware transcript navigation labels
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Poem
🚥 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)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Problem
Fork points and branches whose anchor message isn't user/assistant text
rendered with an empty preview —
Fork point (2 branches)andBranch • <uuid8>— which makes a session's fork structure hard to follow (especially the
tool-flow forks that dominate long, tool-heavy sessions).
What this does
Give fork points and branches a type-aware label:
Fork point • Bash — <description>/… • Thinking.(
_fork_point_previewpreviously returned""for any non-text content.)summary of its first meaningful message (
Bash — <description>/Thinking),while still preferring the branch-local user text when present — preserving
the
/exit("No response requested.") case and the spawned-agent inner-promptexclusion (the existing
test_branch_label_sourceinvariants stay green).Adds two small helpers (
_tool_summary_label,_entry_nav_summary). This ispure labeling — no change to fork detection.
Tests
test/test_fork_branch_labels.pycovers the helpers plus the tool_use/thinkingfork-point and branch cases.
Context
Split out of the investigation into a DAG "branch-happy" staircasing issue
(spurious forks from
max_tokensassistant continuations). The fork-detectionfix is a separate follow-up; this legibility improvement stands on its own.
🤖 Generated with Claude Code
Summary by CodeRabbit
New Features
Tests