Skip to content

Fix explain showing "(no prompt)" for multi-session checkpoints - #633

Merged
khaong merged 2 commits into
mainfrom
alex/fix-explain-missing-multisession-prompt
Mar 6, 2026
Merged

Fix explain showing "(no prompt)" for multi-session checkpoints#633
khaong merged 2 commits into
mainfrom
alex/fix-explain-missing-multisession-prompt

Conversation

@khaong

@khaong khaong commented Mar 6, 2026

Copy link
Copy Markdown
Contributor

Summary

  • ReadLatestSessionPromptFromCommittedTree now iterates backwards through sessions when the latest has no prompt.txt, falling back to earlier sessions that do have a prompt
  • Fixes entire explain showing "(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 in docs/plans/2026-03-05-explain-bugs.md)

Test plan

  • Added test: falls back to earlier session when latest has no prompt
  • Added test: falls back through multiple empty sessions to find prompt
  • Added test: returns empty when no session has a prompt
  • Added test: empty prompt.txt triggers fallback
  • All existing TestReadLatestSessionPromptFromCommittedTree subtests pass
  • Full strategy test suite passes

🤖 Generated with Claude Code

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
@khaong
khaong requested a review from a team as a code owner March 6, 2026 05:57
Copilot AI review requested due to automatic review settings March 6, 2026 05:57
@cursor

cursor Bot commented Mar 6, 2026

Copy link
Copy Markdown

PR Summary

Low Risk
Low risk: small, localized change to prompt lookup logic plus additional tests; behavior only changes when the latest session lacks a usable prompt.txt.

Overview
Fixes prompt resolution for committed multi-session checkpoints by updating ReadLatestSessionPromptFromCommittedTree to scan backward from the latest session until it finds a non-empty prompt, instead of returning empty when the latest session is missing/empty.

Adds unit tests covering fallback across missing prompt.txt, empty prompt.txt, multiple empty sessions, and the all-missing case.

Written by Cursor Bugbot for commit f7a1351. Configure here.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 ReadLatestSessionPromptFromCommittedTree to iterate backward across sessions and return the first non-empty extracted prompt.
  • Add unit tests covering fallback behavior across missing/empty prompt.txt scenarios, 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.

@khaong
khaong enabled auto-merge March 6, 2026 11:39
@khaong
khaong merged commit 1426581 into main Mar 6, 2026
3 checks passed
@khaong
khaong deleted the alex/fix-explain-missing-multisession-prompt branch March 6, 2026 11:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants