Skip to content

fix(todo-continuation-enforcer): skip continuation when only compaction messages exist#2597

Merged
acamq merged 1 commit intodevfrom
fix/todo-compaction-only-guard
Mar 16, 2026
Merged

fix(todo-continuation-enforcer): skip continuation when only compaction messages exist#2597
acamq merged 1 commit intodevfrom
fix/todo-compaction-only-guard

Conversation

@acamq
Copy link
Copy Markdown
Collaborator

@acamq acamq commented Mar 16, 2026

Summary

  • Fixes a regression where idle continuation could still inject when message history contained only compaction entries and no resolvable agent.
  • resolveLatestMessageInfo now returns both resolved agent/model info and whether compaction messages were encountered during scan.
  • handleSessionIdle now treats compaction-only history as a skip condition even when the time-window compaction guard is not active.

Why

  • The previous guard depended on recentCompactionAt timing, which can miss compaction-only history scenarios and allow unintended continuation injection.

Verification

  • bun test src/hooks/todo-continuation-enforcer/todo-continuation-enforcer.test.ts
  • bun test src/hooks/todo-continuation-enforcer
  • bun run typecheck

Summary by cubic

Skip idle continuation when the session history only has compaction messages. Fixes a regression that could inject continuation without a resolvable agent.

  • Bug Fixes
    • resolveLatestMessageInfo now returns { resolvedInfo, encounteredCompaction } and tracks compaction during the scan.
    • handleSessionIdle now 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.

Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@acamq acamq merged commit 8401e61 into dev Mar 16, 2026
7 of 8 checks passed
@acamq acamq deleted the fix/todo-compaction-only-guard branch March 16, 2026 02:20
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