Skip to content

fix(agents): add termination criteria to Sisyphus-Junior default#2544

Merged
code-yeongyu merged 1 commit intocode-yeongyu:devfrom
djdembeck:fix/quick-anti-loop-v2
Mar 25, 2026
Merged

fix(agents): add termination criteria to Sisyphus-Junior default#2544
code-yeongyu merged 1 commit intocode-yeongyu:devfrom
djdembeck:fix/quick-anti-loop-v2

Conversation

@djdembeck
Copy link
Copy Markdown
Contributor

@djdembeck djdembeck commented Mar 12, 2026

Summary

Fixes status-checking loops in the quick category agent by adding explicit termination criteria to default.ts.

Problem

The quick agent (used by Nemotron, GLM 4.7 Flash, and other non-GPT models) exhibited "completion anxiety" loops:

  • Repeatedly reading todo lists without modifications
  • Running "final test verification" over and over despite tests passing
  • Creating verification todo chains: "Verify X" → "Final verification" → "Double-check"

Root Cause

The Sisyphus-Junior default.ts prompt tells the agent what to verify, but not when to stop:

<Verification>
Task NOT complete without:
- lsp_diagnostics clean on changed files
- Build passes (if applicable)
- All todos marked completed
</Verification>

Missing: Termination criteria. The agent keeps verifying because no one told it to stop after first success.

Model routing context:

  • GPT models → gpt.ts (has some termination guidance)
  • Gemini models → gemini.ts
  • Nemotron, GLM 4.7 Flash, Claude, others → default.ts (this fix)

Solution

Added <Termination> section to src/agents/sisyphus-junior/default.ts:

<Termination>
STOP after first successful verification. Do NOT re-verify.
Maximum status checks: 2. Then stop regardless.
</Termination>

Changes

  • File: src/agents/sisyphus-junior/default.ts
  • Lines: +5 (Termination section after Verification)
  • Scope: Affects Nemotron, GLM 4.7 Flash, Claude, and other non-GPT/non-Gemini models

Testing

  • ✅ 40/40 tests pass
  • ✅ Build succeeds
  • ✅ Termination section verified in bundled output

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 1 file

Confidence score: 5/5

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

Auto-approved: The change is a prompt-only addition to prevent loops. It has no code logic changes, passes all tests, and addresses a specific reliability issue without risk of regression.

@code-yeongyu code-yeongyu added the triage:bug Confirmed bug with repro steps label Mar 24, 2026
@code-yeongyu code-yeongyu merged commit a3519c3 into code-yeongyu:dev Mar 25, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

triage:bug Confirmed bug with repro steps

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants