Skip to content

fix: add iteration limits to prevent infinite loops (#1349)#1661

Open
code-yeongyu wants to merge 1 commit intodevfrom
fix-1349
Open

fix: add iteration limits to prevent infinite loops (#1349)#1661
code-yeongyu wants to merge 1 commit intodevfrom
fix-1349

Conversation

@code-yeongyu
Copy link
Owner

@code-yeongyu code-yeongyu commented Feb 8, 2026

Fixes #1349

Summary

Adds configurable iteration limits to the todo-continuation-enforcer hook to prevent Sisyphus-Junior from getting stuck in infinite loops.

Changes

  • Added max_stale_injections config to schema with sensible default
  • Implemented injection counting and circuit breaker in todo-continuation-enforcer
  • Loop stops after N consecutive injections without todo completion progress
  • Added tests for the iteration limit behavior (BDD format)

Testing

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

Summary by cubic

Add iteration limits and a circuit breaker to the todo-continuation enforcer to prevent infinite loops. Caps total injections and stops on consecutive stale cycles, with a warning toast and reset on user activity.

  • Bug Fixes
    • Added todo_continuation config: max_injections (default 8) and max_stale_injections (default 3).
    • Count injections and detect no-progress cycles; stop continuation, cancel countdowns, and show a warning toast.
    • Reset on user messages; wired config into the plugin; added tests for max-injection and stale-progress scenarios.

Written for commit bb45b0e. 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.

marlon-costa-dc pushed a commit to marlon-costa-dc/oh-my-opencode that referenced this pull request Feb 10, 2026
…nite loops (code-yeongyu#1349)

# Conflicts:
#	src/config/index.ts
#	src/config/schema.ts
#	src/hooks/todo-continuation-enforcer.ts
#	src/hooks/unstable-agent-babysitter/index.test.ts
#	src/index.ts
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]: Sisyphus-Junior stuck in infinite loop endlessly refactoring Python type hints (dict vs Dict)

1 participant