fix(session): keep open findings when HEAD moves - #17
Merged
Conversation
A session is identified by ref and HEAD hash together, so the first commit after a review created a new one and left every thread and walkthrough behind in the old session - present in the database, invisible in the browser. That breaks reviewing your own change exactly where it matters: acting on a finding is what moves HEAD. Open threads and walkthroughs are now moved into the new session. Resolved and dismissed threads stay behind, since they belong to the commit where they were dealt with and reopening them on every later commit would be noise. Line numbers are not re-anchored yet, so a thread whose code moved still points at the line it was written against; anchor_content is already stored for that. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018PkYQzbsnMihHesafWvXKs
This was referenced Aug 21, 2026
fiddur
marked this pull request as ready for review
August 21, 2026 13:35
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.
The blocker for reviewing your own change, found while wiring #16.
A session is identified by ref and HEAD hash together:
So the first commit after a review creates a new session and leaves every thread and walkthrough
behind in the old one — still in the database, invisible in the browser. That breaks the own-PR loop
exactly where it matters, because acting on a finding is what moves HEAD. It is also why the live
session on NCBackend3#14360 showed the walkthrough but none of the five findings: they were stranded
in an earlier session after
gh pr checkoutfast-forwarded the branch.Open threads and walkthroughs are now moved into the new session. Moved rather than copied, so ids
stay stable and nothing duplicates. Resolved and dismissed threads stay behind — they belong to the
commit where they were dealt with, and reopening them on every later commit would be noise.
Tested end to end against a real repository: create a session, add an open finding, a resolved one
and a walkthrough, commit, and assert the open finding and the walkthrough follow while the resolved
one stays.
vitestwired for thediffityCLI package, which had no tests.Not done yet: line numbers are not re-anchored, so a thread whose code moved still points at the
line it was written against.
anchor_contentis already stored for exactly that, so re-anchoring isthe natural follow-up — and it matters more once findings survive commits.
Stacked on #16.
🤖 Generated with Claude Code
https://claude.ai/code/session_018PkYQzbsnMihHesafWvXKs