Skip to content

fix: stop stagnant todo continuation loops#2370

Open
code-yeongyu wants to merge 5 commits intodevfrom
fix/issue-2322
Open

fix: stop stagnant todo continuation loops#2370
code-yeongyu wants to merge 5 commits intodevfrom
fix/issue-2322

Conversation

@code-yeongyu
Copy link
Owner

@code-yeongyu code-yeongyu commented Mar 7, 2026

Fixes #2322

Summary

  • add stagnation tracking to todo continuation sessions and stop re-injecting after three no-progress continuation cycles
  • reset stagnation state when todo progress resumes or all todos are cleared, using a dedicated helper to keep idle-event gating focused
  • add regression coverage for stagnation tracking and update failure-backoff tests so they continue exercising the failure path without tripping the new stagnation guard

Testing

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

Summary by cubic

Prevents idle todo continuation from looping when todos don’t change. Adds stagnation tracking and stops re-injection after three no-progress cycles. Addresses Linear #2322.

  • Bug Fixes
    • Track incomplete count and stagnation per session; reset on progress or when todos clear.
    • Stop reinjecting after 3 stagnant cycles using a new guard (MAX_STAGNATION_COUNT).
    • Add regression tests and adjust failure-backoff tests to avoid the new guard.

Written for commit fe12fc6. Summary will update on new commits.

Copy link

@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 7 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Auto-approved: Implements stagnation tracking to prevent infinite loops in todo continuation. Includes comprehensive tests and logic to reset tracking when progress is made or todos are cleared.

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.

[Bug]: Sysyphus enters endless loop after job completion – keeps consuming tokens

1 participant