fix(gate): harden issue format routing - #2979
Conversation
|
Bugbot is not enabled for your account, so this pull request was not reviewed. Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs. |
|
Warning Review limit reachedYou’ve reached a temporary PR review limit under our Fair Usage Limits Policy. Next review available in: 15 minutes Your organization has reached its usage spending cap. Adjust your spending cap in the billing tab. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (5)
📝 WalkthroughWalkthroughThe issue formatter now detects more verification commands, rejects vague tasks and subjective acceptance wording, and validates generated content before publication. Guard workflows prevent duplicate optimizer routing and support manual dispatch inputs. Consumer templates mirror these changes. ChangesIssue format automation
Estimated code review effort: 3 (Moderate) | ~25 minutes Sequence Diagram(s)sequenceDiagram
participant IssueEvent
participant FormatGuard
participant IssueOptimizer
participant IssueFormatter
participant GitHubIssue
IssueEvent->>FormatGuard: process invalid issue body
FormatGuard->>FormatGuard: re-fetch issue and check fingerprint
FormatGuard->>IssueOptimizer: dispatch new invalid body
IssueOptimizer->>IssueFormatter: validate generated body
IssueFormatter-->>IssueOptimizer: return validation status
IssueOptimizer->>GitHubIssue: publish validated body and label
Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Comment |
Workflow source neededPR #2979 needs either a linked GitHub issue or one valid non-issue Workflow Source before PR metadata automation can manage it safely. Please do one of:
Once a valid source is present, this warning will not be reposted. |
d262744 to
f70141f
Compare
Automated Status SummaryHead SHA: ae3e198
Coverage Overview
Coverage Trend
Top Coverage Hotspots (lowest coverage)
Low Coverage Files (<50.0%)
Updated automatically; will refresh on subsequent CI/Docker completions. Keepalive checklistScopeNo scope information available Tasks
Acceptance criteria
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d262744d28
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
Pull request overview
This PR hardens the “issue format” routing/validation contract used by the issue-format guard and optimizer so that non-conforming issues are routed consistently (and deduplicated), and formatted issues are only labeled as such after passing the same validator used by the guard.
Changes:
- Tightens
issue_format.pyvalidation (broader runnable “gate” detection, subjective wording ban, and requiring task items to name a concrete target). - Updates the issue-format guard workflow concurrency and dispatch behavior to avoid duplicate optimizer dispatches for identical invalid bodies.
- Adds coverage in
tests/scripts/test_issue_format.pyfor the stricter task validation and additional accepted gate commands.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
tests/scripts/test_issue_format.py |
Updates fixtures and adds new assertions for the tightened validator contract. |
templates/consumer-repo/.github/workflows/agents-issue-format-guard.yml |
Mirrors guard workflow routing/concurrency changes for consumer templates. |
templates/consumer-repo/.github/scripts/issue_format.py |
Mirrors validator hardening for consumer templates. |
.github/workflows/agents-issue-optimizer.yml |
Adds a validator run on optimizer output before considering the issue “formatted”. |
.github/workflows/agents-issue-format-guard.yml |
Adjusts concurrency and deduplicates optimizer dispatches for identical invalid bodies. |
.github/scripts/issue_format.py |
Expands gate patterns, adds subjective-wording ban, and enforces concrete task targets. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
Runner dispatch state for autofix on PR #2979. Do not edit. |
|
Autofix updated these files:
|
There was a problem hiding this comment.
Actionable comments posted: 5
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
.github/workflows/agents-issue-format-guard.yml (1)
124-136: 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick winFail closed when checking the routing marker.
If
gh issue view --json commentsfails,grepreturns no match and!enters the dispatch branch. Fetch comments first, handle fetch errors separately, and dispatch only when the fetch succeeds and the marker is absent.Apply this change at
.github/workflows/agents-issue-format-guard.yml#L124-L136andtemplates/consumer-repo/.github/workflows/agents-issue-format-guard.yml#L124-L136.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In @.github/workflows/agents-issue-format-guard.yml around lines 124 - 136, Update the routing-marker checks in .github/workflows/agents-issue-format-guard.yml:124-136 and templates/consumer-repo/.github/workflows/agents-issue-format-guard.yml:124-136 to fetch issue comments before testing the marker, handle a failed gh issue view separately, and dispatch only when fetching succeeds and the marker is absent.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.github/scripts/issue_format.py:
- Around line 83-86: Update TASK_TARGET in .github/scripts/issue_format.py lines
83-86 and templates/consumer-repo/.github/scripts/issue_format.py lines 83-86 to
require a file path, symbol identifier, command invocation, or a category word
followed by a specific identifier; reject bare categories and arbitrary code
spans. Add negative test cases in tests/scripts/test_issue_format.py lines
157-165 covering those two vague-target forms.
In @.github/workflows/agents-issue-format-guard.yml:
- Around line 23-24: Re-fetch the issue body and relevant labels after the
Resolve issue step, recompute the format and exemption decisions, and abort if
the current state differs before any comments, label changes, or optimizer
dispatch. Apply the same update to both
.github/workflows/agents-issue-format-guard.yml and
templates/consumer-repo/.github/workflows/agents-issue-format-guard.yml at lines
23-24.
- Around line 134-136: Harden the duplicate-dispatch branch by validating the
deduplication marker as an exact marker emitted by the trusted automation actor,
or replace it with non-user-editable state before setting dispatch=false. Apply
the same change at .github/workflows/agents-issue-format-guard.yml lines 134-136
and templates/consumer-repo/.github/workflows/agents-issue-format-guard.yml
lines 134-136; do not allow public fingerprint or substring matches alone to
suppress the format phase dispatch.
- Around line 145-147: Make the format-guard routing state recoverable by
changing the dispatch-suppression logic around dispatch in both
.github/workflows/agents-issue-format-guard.yml (lines 145–147) and
templates/consumer-repo/.github/workflows/agents-issue-format-guard.yml (lines
145–147): do not permanently suppress dispatch solely because
format-guard:$fingerprint exists; store pending state or suppress only after a
matching optimizer run completes successfully, allowing retries after dispatch
or optimizer failure.
In @.github/workflows/agents-issue-optimizer.yml:
- Around line 577-580: Validate the apply-phase output before assigning
agents:formatted. In .github/workflows/agents-issue-optimizer.yml lines 577-580,
validate /tmp/updated_body.md during apply, or suppress the label for that
phase; apply the same change to
templates/consumer-repo/.github/workflows/agents-issue-optimizer.yml lines
508-512. Keep the existing format-phase validation intact.
---
Outside diff comments:
In @.github/workflows/agents-issue-format-guard.yml:
- Around line 124-136: Update the routing-marker checks in
.github/workflows/agents-issue-format-guard.yml:124-136 and
templates/consumer-repo/.github/workflows/agents-issue-format-guard.yml:124-136
to fetch issue comments before testing the marker, handle a failed gh issue view
separately, and dispatch only when fetching succeeds and the marker is absent.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: 094a7875-a1b4-4ea8-98b5-fbd695ae58cf
📒 Files selected for processing (8)
.github/scripts/issue_format.py.github/workflows/agents-issue-format-guard.yml.github/workflows/agents-issue-optimizer.ymlconfig/template-drift-allowlist.txttemplates/consumer-repo/.github/scripts/issue_format.pytemplates/consumer-repo/.github/workflows/agents-issue-format-guard.ymltemplates/consumer-repo/.github/workflows/agents-issue-optimizer.ymltests/scripts/test_issue_format.py
Closer review disposition (31f1232)Addressed the open review threads on this PR:
Validation: Not merging this round: post-push 7-minute review window + required checks must clear on head |
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.github/workflows/agents-issue-format-guard.yml:
- Around line 146-153: Update the handoff deduplication logic in both
.github/workflows/agents-issue-format-guard.yml lines 146-153 and
templates/consumer-repo/.github/workflows/agents-issue-format-guard.yml lines
146-153 to track pending, active, and failed handoffs separately. Suppress
dispatch for a matching active handoff, and retry only when a confirmed failed
handoff is recorded; do not treat the agents:format label as evidence of
failure.
- Around line 127-132: Update the validator handling around the live python3
issue_format.py invocation in both
.github/workflows/agents-issue-format-guard.yml lines 127-132 and
templates/consumer-repo/.github/workflows/agents-issue-format-guard.yml lines
127-132: capture the validator’s exit code and stderr, continue to optimizer
routing only for the documented invalid-format exit status from Validate against
AGENT_ISSUE_FORMAT, and fail the step for any unexpected validator or
infrastructure error.
In `@tests/workflows/test_agents_issue_optimizer_format_trigger.py`:
- Around line 37-45: Update
test_format_guard_retries_incomplete_optimizer_dispatch to assert the complete
re-fetch and completion-marker contract for both the primary workflow and the
consumer template workflow. Apply the same required guard-string assertions,
including “Re-fetch before side effects” and the fingerprint marker, to each
loaded workflow while retaining the retry-message checks.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: 18270b5e-ecbc-4b1d-a391-a9ff0816be77
📒 Files selected for processing (8)
.github/scripts/issue_format.py.github/workflows/agents-issue-format-guard.yml.github/workflows/agents-issue-optimizer.ymltemplates/consumer-repo/.github/scripts/issue_format.pytemplates/consumer-repo/.github/workflows/agents-issue-format-guard.ymltemplates/consumer-repo/.github/workflows/agents-issue-optimizer.ymltests/scripts/test_issue_format.pytests/workflows/test_agents_issue_optimizer_format_trigger.py
Closer review disposition (31f1232)Addressed the open review threads on this PR:
Validation: Not merging this round: post-push 7-minute review window + required checks must clear on head |
Tighten concrete task-target detection, make format-guard dispatch retryable after failed optimizer starts, validate apply-phase bodies, and keep consumer templates aligned. Co-authored-by: Cursor <cursoragent@cursor.com>
9ecff66 to
dd59738
Compare
Closer verifier disposition — skipped (no acceptance criteria)Agents Verifier run Skip reason (durable): Evidence:
Closer treats this as terminal verifier disposition for #2979 (skip ≠ pending). |
Source-of-truth repair for active consumer-sync review debt.\n\n- preserves in-flight validation across ignored label events and deduplicates identical invalid-body optimizer dispatches\n- validates optimizer output before applying
agents:formatted\n- accepts documented runnable verification commands, rejects vague task items, and aligns subjective wording with the contract\n- updates exact consumer-template copies\n\nValidation:python -m pytest -q tests/scripts/test_issue_format.py tests/workflows/test_agents_issue_optimizer_format_trigger.py(26 passed);python scripts/validate_template_completeness.py;python scripts/validate_template_sync.py;git diff --check.Summary by CodeRabbit
New Features
Bug Fixes
Tests