fix(todo-continuation-enforcer): add plan agent to DEFAULT_SKIP_AGENTS (fixes #2526)#2589
Merged
code-yeongyu merged 1 commit intocode-yeongyu:devfrom Mar 25, 2026
Conversation
Contributor
|
All contributors have signed the CLA. Thank you! ✅ |
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: Targeted fix for a reported infinite loop by adding 'plan' to the skip list, accompanied by a regression test and documentation update. No risk of impact on other functionality.
Contributor
Author
|
I have read the CLA Document and I hereby sign the CLA |
…S to prevent infinite loop The todo-continuation-enforcer injects continuation prompts when sessions go idle with pending todos. When Plan Mode agents (which are read-only) create todo items, the continuation prompt contradicts Plan Mode's STRICTLY FORBIDDEN directive, causing an infinite loop where the agent acknowledges the conflict then goes idle, triggering another injection. Adding 'plan' to DEFAULT_SKIP_AGENTS prevents continuation injection into Plan Mode sessions, matching the same exclusion pattern already used for prometheus and compaction agents. Fixes code-yeongyu#2526
3ef65d2 to
2b6b083
Compare
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
"plan"toDEFAULT_SKIP_AGENTSintodo-continuation-enforcer/constants.tsto prevent the infinite loop reported in [Bug]: Stuck during planning #2526Problem
When a Plan Mode agent creates todo items, the
todo-continuation-enforcerhook fires onsession.idleand injects a continuation prompt telling the agent to "proceed without asking permission." But Plan Mode explicitly forbids all file edits ("STRICTLY FORBIDDEN: ANY file edits... This supersedes all other instructions"). The agent receives both contradictory directives, acknowledges the conflict, explains why it cannot proceed, then goes idle again — triggering another injection in an infinite loop.Root cause analysis by @R-omk in #2526: the
injectContinuation()function checksDEFAULT_SKIP_AGENTSbut only skipsprometheusandcompaction, notplan.Fix
This is the minimal, targeted fix: plan agents are read-only by design and should never receive continuation nudges.
Changes
constants.ts"plan"toDEFAULT_SKIP_AGENTScontinuation-injection.test.tsAGENTS.mdTesting
skips injection when agent is plan (prevents Plan Mode infinite loop)— verifiesinjectContinuationdoes not callpromptAsyncwhen agent is"plan"Fixes #2526
Summary by cubic
Skip continuation injection for
plansessions to stop the Plan Mode infinite loop. AddsplantoDEFAULT_SKIP_AGENTS, plus a regression test and docs update. Fixes #2526.Written for commit 2b6b083. Summary will update on new commits.