fix: save cursor on early return in get_events resume path - #103
Merged
Conversation
When resume=True encounters a session without a saved cursor, the early return path now persists the current high-water mark so subsequent resume calls can pick up new events. Without this, sessions would perpetually hit the "no cursor" branch and never see new events. Fixes #102 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Code ReviewSummaryFixes a bug where CriticalNone ImportantNone SuggestionsNone VerdictAPPROVE - The fix is minimal, correct, and well-tested. The Automated review by Claude Code |
evansenter
added a commit
that referenced
this pull request
Mar 31, 2026
… tests (#114) Split the resume early-return branch into two distinct paths: - Session exists but no cursor: persist tip cursor (builds on #103) - Session doesn't exist: return {"error": "Session not found"} instead of silently returning empty events Add regression tests for rapid polling event loss and pre-existing event filtering with resume=True. Fixes #114 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
5 tasks
evansenter
added a commit
that referenced
this pull request
Mar 31, 2026
* docs: Add design spec for resume cursor persistence fix (#114) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: Return error for resume with nonexistent session, add regression tests (#114) Split the resume early-return branch into two distinct paths: - Session exists but no cursor: persist tip cursor (builds on #103) - Session doesn't exist: return {"error": "Session not found"} instead of silently returning empty events Add regression tests for rapid polling event loss and pre-existing event filtering with resume=True. Fixes #114 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * style: Address review feedback — clarify test differentiation, fix stale line refs Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.
Summary
get_eventswhenresume=Trueencounters a session without a saved cursor--resumeFixes #102
Test plan
test_resume_saves_cursor_on_early_returnvalidates end-to-end behaviorruff format --check,ruff check)🤖 Generated with Claude Code