fix(agents): fail closed format guard revalidation - #2987
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. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughChangesThe workflows now use event-scoped manual issue inputs. Format revalidation distinguishes valid content, ordinary format failures, and unexpected validator errors. Regression coverage and template-drift fingerprints were updated. Issue workflow routing
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant ManualDispatch
participant FormatGuard
participant Validator
participant IssueOptimizer
ManualDispatch->>FormatGuard: Provide issue_number through github.event.inputs
FormatGuard->>Validator: Revalidate issue format
Validator-->>FormatGuard: Return exit code and stderr
FormatGuard->>IssueOptimizer: Dispatch for ordinary format failure
Possibly related PRs
Suggested labels: 🚥 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 #2987 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. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0ce6dcf870
ℹ️ 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".
16e4c96 to
b04ce02
Compare
There was a problem hiding this comment.
Pull request overview
Updates the agents issue format guard / optimizer workflows to use event-safe github.event.inputs references (avoiding dispatch-only inputs in concurrency keys), and aims to fail closed when live issue revalidation encounters unexpected validator failures. Changes are applied to both the repo workflows and the consumer template workflows, with regression assertions added to enforce the new patterns.
Changes:
- Replace
inputs.issue_numberusage in concurrency group keys withgithub.event.inputs.issue_number(withgithub.run_idfallback). - Update the issue-format guard to capture and act on validator exit codes during live revalidation.
- Add regression tests asserting event-safe inputs usage and the intended revalidation behavior across source + template workflows.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
tests/workflows/test_agents_issue_optimizer_format_trigger.py |
Adds regression assertions for event-safe inputs usage and revalidation behavior across source/template workflows. |
templates/consumer-repo/.github/workflows/agents-issue-optimizer.yml |
Updates concurrency group key to use github.event.inputs.issue_number fallback. |
templates/consumer-repo/.github/workflows/agents-issue-format-guard.yml |
Updates concurrency group key and revalidation handling in the consumer template workflow. |
.github/workflows/agents-issue-optimizer.yml |
Updates concurrency group key to use github.event.inputs.issue_number fallback. |
.github/workflows/agents-issue-format-guard.yml |
Updates concurrency group key and revalidation handling in the source workflow. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| assert "github.event.inputs.issue_number ||\n github.run_id" in text | ||
| assert "github.event.issue.number || github.event.inputs.issue_number" in text | ||
| assert "revalidate_rc=$?" in text | ||
| assert 'if [[ "$revalidate_rc" -ne 1 ]]; then' in text | ||
|
|
Automated Status SummaryHead SHA: bd8a762
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
|
b04ce02 to
03f7532
Compare
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 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 138-149: Update both revalidation blocks in
.github/workflows/agents-issue-format-guard.yml (lines 138-149) and
templates/consumer-repo/.github/workflows/agents-issue-format-guard.yml (lines
138-149) to capture validator stderr alongside the exit status. Treat exit code
1 with non-empty stderr as a validator runtime error, log it, and stop before
fingerprint calculation or optimizer dispatch; preserve success handling and
propagate all other non-zero exit codes.
In `@tests/workflows/test_agents_issue_optimizer_format_trigger.py`:
- Around line 107-121: Strengthen
test_format_guard_uses_event_inputs_and_fails_closed_on_revalidation_errors to
assert the complete revalidation routing branches: exit 0 skips dispatch, exit 1
continues, and any other exit code stops the step. Require the full fallback
expression, including github.event.issue.number, in each optimizer concurrency
configuration, rather than checking only partial fragments.
🪄 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: 3fc6497d-33eb-4336-b70b-a7b0fc0c290b
📒 Files selected for processing (6)
.github/workflows/agents-issue-format-guard.yml.github/workflows/agents-issue-optimizer.ymlconfig/template-drift-allowlist.txttemplates/consumer-repo/.github/workflows/agents-issue-format-guard.ymltemplates/consumer-repo/.github/workflows/agents-issue-optimizer.ymltests/workflows/test_agents_issue_optimizer_format_trigger.py
Treat exit 1 with non-empty stderr as a validator crash and fail closed before fingerprinting or optimizer dispatch, matching the initial Validate step. Strengthen regression assertions for the routing branches. Co-authored-by: Cursor <cursoragent@cursor.com>
Closer review recovery (head
|
|
Runner dispatch state for autofix on PR #2987. Do not edit. |
|
Runner dispatch state for codex on PR #2987. Do not edit. |
|
Autofix updated these files:
|
|
Reviewed current head |
Summary
inputsreferences in issue-format guard and optimizer concurrency keys with event-safe inputsValidation
python -m pytest -q tests/workflows/test_agents_issue_optimizer_format_trigger.py tests/scripts/test_issue_format.py(40 passed)git diff --checkThe full template-drift check still reports the pre-existing optimizer source/template divergence; this change updates both respective concurrency surfaces without collapsing that intentionally different workflow implementation.
Summary by CodeRabbit
Bug Fixes
Tests