Skip to content

Say just which entries after the last message a handoff had no room for - #80

Merged
joeychilson merged 3 commits into
mainfrom
handoff-stopped-gap
Oct 19, 2026
Merged

joeychilson merged 3 commits into
mainfrom
handoff-stopped-gap

Conversation

@joeychilson

@joeychilson joeychilson commented Oct 19, 2026 •

Copy link
Copy Markdown
Owner

"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:

  • System notes, which every part of a handoff leaves out, counted as left out for room. A note right after the last message, with everything after it shown, made it say "Entry Restyle Settings and show Turnscope's logo in the menu bar #2 is left out for room." A note just after the last message, or just after the entry that didn't fit, stretched the range over it.
  • When none of the entries after the last message fit, there was no first one shown, and it said nothing of them.

stopped now takes the gap from what fit reports: it ends at the entry that didn't fit, as story'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, since fit skips 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.

story has 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_room checks four cases. On origin/main each fails. A note right after the last message, all else shown:

thread 'sessions::handoff::tests::where_it_stopped_says_just_what_it_left_out_for_room' panicked at src/sessions/handoff.rs:1023:9:
...
#1 assistant · 18:01
> Running the tests.

Entry #2 is left out for room.

#3 tool `Bash` (failed)

Room running out at #2, with a note at #3 (with the first assertion commented out):

panicked at src/sessions/handoff.rs:1030:9:
...
Entries #2 to #3 are left out for room.

No room for #2, the one entry after the last message (with the first two commented out):

panicked at src/sessions/handoff.rs:1033:9:

## Where it stopped

Its last message, then the 1 entry after it: the work in progress.

#1 assistant · 18:01
> Running the tests.

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:

panicked at src/sessions/handoff.rs:1035:9:
...
#1 assistant · 18:01
> Running the tests.

Entries #2 to #3 are left out for room.

#4 tool `Bash` (failed)

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:

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 --locked and RUSTDOCFLAGS="-D warnings" cargo doc --no-deps --locked all pass, after the merge and the fix. Not run: the Swift tests, shellcheck, actionlint and cargo deny, since nothing they cover changed.

@joeychilson
joeychilson merged commit b4c529b into main Oct 19, 2026
3 checks passed
@joeychilson
joeychilson deleted the handoff-stopped-gap branch October 19, 2026 22:21
joeychilson added a commit that referenced this pull request Oct 19, 2026
#89)

A handoff's story, "What it found and did", said system notes and tool calls were left out for room when they opened the session or followed the summary, though it leaves them out anyway. That range now starts at the first entry the story would show, as "Where it stopped" does since #80.
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.

1 participant