fix(todo-continuation-enforcer): skip continuation when only compaction messages exist#2597
Merged
fix(todo-continuation-enforcer): skip continuation when only compaction messages exist#2597
Conversation
…y message history
There was a problem hiding this comment.
No issues found across 3 files
Confidence score: 5/5
- Automated review surfaced no issues in the provided summaries.
- No files require special attention.
Auto-approved: The PR fixes the continuation regression by correctly identifying sessions with only compaction history. Logic is sound, type-safe, and improves the robustness of the idle skip condition.
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
compactionentries and no resolvable agent.resolveLatestMessageInfonow returns both resolved agent/model info and whether compaction messages were encountered during scan.handleSessionIdlenow treats compaction-only history as a skip condition even when the time-window compaction guard is not active.Why
recentCompactionAttiming, which can miss compaction-only history scenarios and allow unintended continuation injection.Verification
bun test src/hooks/todo-continuation-enforcer/todo-continuation-enforcer.test.tsbun test src/hooks/todo-continuation-enforcerbun run typecheckSummary by cubic
Skip idle continuation when the session history only has
compactionmessages. Fixes a regression that could inject continuation without a resolvable agent.resolveLatestMessageInfonow returns{ resolvedInfo, encounteredCompaction }and trackscompactionduring the scan.handleSessionIdlenow skips when no agent is resolved and either the compaction guard is active or compaction-only history was detected.Written for commit 9e7abe2. Summary will update on new commits.