diff --git a/tools/gemini-cli-bot/.gemini/skills/issue-fixer/SKILL.md b/tools/gemini-cli-bot/.gemini/skills/issue-fixer/SKILL.md index a34f2162ff..deceb1f8f3 100644 --- a/tools/gemini-cli-bot/.gemini/skills/issue-fixer/SKILL.md +++ b/tools/gemini-cli-bot/.gemini/skills/issue-fixer/SKILL.md @@ -16,7 +16,7 @@ maintain existing PRs to reduce the repository backlog. 2. **Discovery**: Find open issues labeled `effort/small`. Prioritize those with clear reproduction steps. You are STRICTLY FORBIDDEN from using local commands (e.g., `npm run lint`, `npm run typecheck`, or grepping for TODOs) to find new work. 3. **Autonomous Implementation**: You are responsible for the entire fix: research, code changes, and test verification. 4. **Surgical Precision**: Changes must be minimal and strictly focused on the identified issue. Avoid "drive-by" refactoring. -5. **Local Verification**: You MUST run `timeout 10m npm run preflight` locally and iterate on any failures before finalizing your PR. Local commands are for VERIFICATION ONLY, never for discovery. +5. **Local Verification (MANDATORY TIMEOUTS)**: You MUST run `timeout 10m npm run preflight` (or `timeout 5m npm test ...`) locally and iterate on any failures before finalizing your PR. Wrapping test commands in `timeout` is **MANDATORY** to prevent hanging the CI environment if your changes introduce an infinite loop. 6. **Expert Mentions**: Identify the domain expert for the affected files and CC them in the PR description. 7. **Focused Contributions**: Limit your active PRs to ~10 at a time. Try to complete existing PRs before opening new ones. If a maintainer closes a PR, that may be an indication that they are rejecting the fix. diff --git a/tools/gemini-cli-bot/brain/scheduled.md b/tools/gemini-cli-bot/brain/scheduled.md index 1b4c017468..92e0456488 100644 --- a/tools/gemini-cli-bot/brain/scheduled.md +++ b/tools/gemini-cli-bot/brain/scheduled.md @@ -94,3 +94,19 @@ For any detected bugs, bottlenecks, or opportunities: - **Strict Read-Only Reasoning**: You cannot push code or post comments via API. Your only way to effect change is by writing to specific files and explicitly staging file changes using the `git add` command. + +## Loop Prevention & Success Criteria + +To ensure efficiency and prevent infinite reasoning loops: + +1. **Monitor Your Progress**: If you have attempted the same sequence of + actions (e.g., Edit -> Test -> Fail) for the same problem more than **3 + times**, you MUST stop and re-evaluate your fundamental hypothesis. +2. **Failure Threshold**: If you cannot find a verified solution after **2 + distinct hypotheses** (max 6 total edit/test cycles), you MUST abort the + task. +3. **Reporting Failure**: If you abort, summarize the roadblocks you + encountered in `lessons-learned.md`. It is better to deliver NO changes than + to burn excessive tokens on a loop. +4. **Verification is Key**: A task is only "complete" when all relevant tests + pass. Never stage a change that you know still fails tests.