Repository navigation
Say just which entries after the last message a handoff had no room for - #80
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
"Where it stopped" (
stopped) shows the agent's last message, then the latest entries after it that fit, and says which entries between them were left out for room. It took that gap to be every entry before the first one it showed, which went wrong two ways:stoppednow takes the gap from whatfitreports: it ends at the entry that didn't fit, asstory's cut does, and starts at the first entry after the last message that isn't a system note. The end is never a note, sincefitskips notes, and with no entry that didn't fit there's no gap line. A note in the middle of the range stays in it, so the range is still one run of entries.storyhas the same edge: its range of entries left out for room starts at the first entry after the summary, which can be a system note. I left it alone here.The new test
sessions::handoff::tests::where_it_stopped_says_just_what_it_left_out_for_roomchecks four cases. On origin/main each fails. A note right after the last message, all else shown:Room running out at #2, with a note at #3 (with the first assertion commented out):
No room for #2, the one entry after the last message (with the first two commented out):
A note at #2, room running out at #3, #4 shown: added in review, after the first fix. It fails on that first fix as well as on origin/main:
All four pass with the fix. The branch has origin/main merged in, with no conflict.
Handoff cases: there are no real ones on this machine, and I didn't make any from real sessions. I handed off 76 made-up cases at budgets of 150, 500, 1,200, 3,000 and 16,000 tokens, with origin/main (
ac56c6c) and with this branch: the six fixture sessions, 40 random Claude Code sessions, and 30 random sessions, ten each in Claude Code's, OpenCode's and Codex's own tool shapes. 152 of the 380 handoffs changed. In every one, "Where it stopped" shows the same entries as before; only its line saying what was left out for room changed:synthetic-3,-6,-12,-21,-27,-39, at 1,200), the line's room comes out of the summary's, which is cut 9 to 22 characters sooner. Nothing else in them changed.synthetic-24(#112) at 1,200, 3,000 and 16,000;extra-opencode-16(Check models.dev's prices when the catalog is taken in #57) andsynthetic-36(#101) at 3,000 and 16,000;synthetic-8(Look up what's in force, and take a lock, one way each #59) andsynthetic-28(Name the account by its title in the headline and notifications #3) at 16,000.extra-opencode-16at 1,200, Check models.dev's prices when the catalog is taken in #57 to Simplify the Claude Code reader without changing what it reads #58 now Simplify the Claude Code reader without changing what it reads #58 alone;synthetic-24at 500, #112 to #114 now #113 to #114;synthetic-28at 1,200 and 3,000, Name the account by its title in the headline and notifications #3 to Simplify limits and the providers #44 and Name the account by its title in the headline and notifications #3 to Simplify the app and TurnscopeKit #37 now from Sign releases on a runner that never builds #4;synthetic-8at 3,000, Look up what's in force, and take a lock, one way each #59 to Name an OpenCode or notebook read by its file in a handoff #75 now from Decide whether readings share a reset in one place #60;synthetic-36at 1,200, #101 to #102 now #102 alone, which leaves the summary 5 characters more.extra-claude-code-21at 150, Find a Codex script's tools by its name, not by tools. anywhere in a call's input #77 to Say just which entries after the last message a handoff had no room for #80 now Find a Codex script's tools by its name, not by tools. anywhere in a call's input #77 to Name the handoff cases test by its real path #79;synthetic-32at 1,200, Take what a Codex rewind went back past out of search #32 to Simplify ingest, alerts, prices and the forecast's types #36 now Take what a Codex rewind went back past out of search #32 to Share the agent readers' repeated code, and simplify Claude Code and Pi #35;synthetic-37at 1,200, Turn on the repository settings SECURITY.md relies on #27 to Escape what a search quotes from a session #41 now Turn on the repository settings SECURITY.md relies on #27 to Simplify the CLI tests, the Swift tests and the screenshot script #40;synthetic-7at 3,000, Prepare release 0.1.5 #92 to Bump the rust group with 2 updates #93 now Prepare release 0.1.5 #92 alone.Against the first version of this PR, the review fix changed 16 of those handoffs, all by starting the range past a system note: the 6 "start" ones above and 10 of the 133.
No snapshot changed: no fixture session's handoff leaves anything out of "Where it stopped".
Checked:
cargo fmt --check,cargo clippy --all-targets --locked -- -D warnings,cargo test --locked,TZ=America/Chicago cargo test --lockedandRUSTDOCFLAGS="-D warnings" cargo doc --no-deps --lockedall pass, after the merge and the fix. Not run: the Swift tests, shellcheck, actionlint and cargo deny, since nothing they cover changed.