Fix explain showing "(no prompt)" for multi-session checkpoints - #633
Conversation
ReadLatestSessionPromptFromCommittedTree now falls back through earlier sessions when the latest has no prompt.txt. This handles contaminated checkpoints where an empty session was condensed alongside a real one. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Entire-Checkpoint: 10bbaa186d80
PR SummaryLow Risk Overview Adds unit tests covering fallback across missing Written by Cursor Bugbot for commit f7a1351. Configure here. |
There was a problem hiding this comment.
Pull request overview
This PR fixes entire explain showing “(no prompt)” for committed checkpoints that contain multiple sessions where the latest/highest-indexed session doesn’t have a usable prompt.txt. It updates the prompt lookup logic to search backward through sessions until it finds a non-empty prompt, which better matches how condensed checkpoints can be laid out on the metadata branch.
Changes:
- Update
ReadLatestSessionPromptFromCommittedTreeto iterate backward across sessions and return the first non-empty extracted prompt. - Add unit tests covering fallback behavior across missing/empty
prompt.txtscenarios, including multiple empty sessions and the “no prompt anywhere” case.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
cmd/entire/cli/strategy/common.go |
Implements backward fallback across session directories when the latest session has no usable prompt. |
cmd/entire/cli/strategy/common_test.go |
Adds targeted tests to validate fallback behavior for missing/empty prompts across sessions. |
Summary
ReadLatestSessionPromptFromCommittedTreenow iterates backwards through sessions when the latest has noprompt.txt, falling back to earlier sessions that do have a promptentire explainshowing "(no prompt)" for multi-session checkpoints where a contaminated/empty session was condensed as the highest-indexed session (see bug add .entire/logs to .entire/.gitignore, small refactor #3 indocs/plans/2026-03-05-explain-bugs.md)Test plan
prompt.txttriggers fallbackTestReadLatestSessionPromptFromCommittedTreesubtests passstrategytest suite passes🤖 Generated with Claude Code