-
Notifications
You must be signed in to change notification settings - Fork 1.2k
fix(agents): relax Momus input validation and tighten Prometheus Momus calls to avoid false rejections #659
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Add test assertions that encode the new expected prompt behavior for Momus input validation and Prometheus Momus invocation policy. Tests verify that: - Momus prompt treats SYSTEM DIRECTIVE blocks as ignorable - Momus prompt extracts paths containing .sisyphus/plans/ and ending in .md - Momus prompt allows conversational wrappers (removes old "Please review" rejection) - Momus prompt handles ambiguity (multiple paths) and "no path found" cases - Prometheus prompt directs path-only invocation for Momus (no wrappers) These tests will fail until the prompt updates in the next commit (TDD RED phase). Co-Authored-By: Sisyphus <[email protected]>
…s calls Fix the planning workflow where Momus (Plan Reviewer) rejects execution due to strict input format validation when the incoming string contains wrapper text or system directives. Changes: - Momus prompt: Replace strict "ONLY file path" rule with extraction algorithm that finds .sisyphus/plans/*.md paths anywhere in input - Momus prompt: Explicitly ignore [SYSTEM DIRECTIVE - READ-ONLY PLANNING CONSULTATION] blocks appended by Prometheus task tools - Momus prompt: Strip markdown wrappers (backticks, code fences) before path extraction - Momus prompt: Update rejection logic to only reject when no path found or multiple paths found (not when conversational wrappers present) - Momus prompt: Move "Please review .sisyphus/plans/plan.md" from INVALID to VALID examples - Prometheus prompt: Add explicit "MOMUS INVOCATION RULE" directing path-only prompts (even though system hooks may append directives) This unblocks plan reviews by making Momus reliably locate plan file paths from real-world input strings, while tightening Prometheus guidance to avoid adding noise. Tests: All prompt policy tests now pass (TDD GREEN phase) Co-Authored-By: Sisyphus <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.
Was made when testing across different models. Forgot to change it back Co-Authored-By: Sisyphus <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1 issue found across 4 files
Confidence score: 4/5
- Unescaped dots in
src/agents/momus.test.tsmean the constructed regex could match unintended files, so the tests might not actually cover the intended cases. - Given it affects only test reliability, the risk to production behavior remains low and the PR still feels safe to merge with a quick follow-up fix.
- Pay close attention to
src/agents/momus.test.ts- the regex should escape literal dots to ensure accurate test matching.
Prompt for AI agents (all issues)
Check if these issues are valid — if so, understand the root cause of each and fix them.
<file name="src/agents/momus.test.ts">
<violation number="1" location="src/agents/momus.test.ts:33">
P2: Unescaped regex special characters in `new RegExp()`. The `.` characters in the file path will match any character instead of literal dots, potentially causing incorrect test behavior.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1 issue found across 1 file (changes from recent commits).
Prompt for AI agents (all issues)
Check if these issues are valid — if so, understand the root cause of each and fix them.
<file name="src/agents/momus.ts">
<violation number="1">
P2: Model change contradicts PR description. The description claims to switch to `opencode/grok-code`, but the code actually switches to `openai/gpt-5.2`. Please clarify the intended model and update either the code or the PR description to match.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
Escape regex special characters when building RegExp from file path in momus.test.ts. The `.` characters in ".sisyphus/plans/plan.md" were matching any character instead of literal dots. Added escapeRegExp() helper and applied it when constructing the regex pattern. All tests pass. Co-Authored-By: Sisyphus <[email protected]>
…s calls to avoid false rejections (#659)
Summary
While playing around I found that no matter what happens the first prompt from Prometheus to Momus always results in a rejection because of content wrapping the plan path. I also found after every reviewed loop prometheus will forget about the rejection again, this means there are repeat "useless" calls to Momus. Fix the planning workflow where
Momus (Plan Reviewer)rejects execution due to strict input format validation when the incoming string contains wrapper text or system directives injected by Prometheus task tools.Problem
When Prometheus calls task tools (
sisyphus_task,task,call_omo_agent), theprometheus-md-onlyhook appends a multi-line system directive block (PLANNING_CONSULT_WARNING) to the tool prompt. This means Momus routinely receives non-path text even when Prometheus tries to pass only a path.On top of that it seems that Prometheus will occasionally forget its directive on how to communicate with Prometheus and begin appending soft phrases around the file path again.
The original Momus prompt had a strict validation rule: "reject if any additional words exist beyond the file path." This caused valid invocations like
Please review: .sisyphus/plans/issue-623.md(with or without the injected system directive block) to be rejected, blocking plan reviews.Solution Approach
Changes
Momus Agent (
src/agents/momus.ts)Replaced strict input validation with an extraction algorithm:
[SYSTEM DIRECTIVE - READ-ONLY PLANNING CONSULTATION](remove the whole block, including---separators and bullet lines).sisyphus/plans/and ending in.mdUpdated examples: Moved
Please review .sisyphus/plans/plan.mdfrom INVALID to VALIDUpdated rejection messages: Include specific reason (
Reason: no plan path foundorReason: multiple plan paths found)Prometheus Agent (
src/agents/prometheus-prompt.ts)Test Coverage (
src/agents/momus.test.ts,src/agents/prometheus-prompt.test.ts)Before:
Please review: .sisyphus/plans/issue-623.md→ ❌I REJECT (Input Format Validation).sisyphus/plans/plan.mdwith appended[SYSTEM DIRECTIVE...]block → ❌ RejectedAfter:
Please review: .sisyphus/plans/issue-623.md→ ✅ Extracts path, proceeds to review.sisyphus/plans/plan.mdwith appended[SYSTEM DIRECTIVE...]block → ✅ Strips directive block, extracts path, proceedsTesting
momus.test.ts(prompt policy requirements)prometheus-prompt.test.ts(invocation policy)Test Results
.sisyphus/plans/issue-623.mdPlease review: .sisyphus/plans/issue-623.md[analyze-mode]\nPlease review: .sisyphus/plans/issue-623.md[SYSTEM DIRECTIVE - READ-ONLY PLANNING CONSULTATION]blockReview the plan.I REJECT (Input Format Validation)Reason: no plan path foundPlease review both .sisyphus/plans/issue-623.md and .sisyphus/plans/momus-input-validation-prometheus-handoff.mdI REJECT (Input Format Validation)Reason: multiple plan paths foundRelated Issues
Summary by cubic
Fixes false rejections when Prometheus passes plan paths to Momus by relaxing Momus input validation and tightening Prometheus’s Momus calls. This unblocks plan reviews and cuts repeated calls.
Written for commit 49555ca. Summary will update on new commits.