fix(agents): make the optimizer recursion guard actually correlate runs - #2993
Conversation
The guard counts prior optimizer runs for an issue by matching the issue
number against `displayTitle`. workflow_dispatch runs display the bare
workflow name ("Agents Issue Optimizer"), so the filter matched nothing.
Observed on Fine-Art-Archive#464, which the optimizer re-ran roughly once a
minute for ~20 hours while its own guard logged:
Optimizer runs for issue #464 in last hour: 0
Set `run-name` so both trigger types carry `#<issue>`, raise the `gh run
list` window past its 20-run default (a tight loop exhausts that inside the
hour), and match with `endswith` rather than `contains` so the new suffix
form cannot count #4640 against #464.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
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: 19 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 (3)
Comment |
Automated Status SummaryHead SHA: 839396e
Coverage Overview
Updated automatically; will refresh on subsequent CI/Docker completions. Keepalive checklistScopeAddress unmet acceptance criteria from PR #463. Original scope:
Context for AgentRelated Issues/PRsTasks
Acceptance criteria
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 24b65c3c64
ℹ️ 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".
| run-name: >- | ||
| Agents Issue Optimizer #${{ | ||
| github.event.issue.number || inputs.issue_number }} |
There was a problem hiding this comment.
Apply the recursion guard fix to the consumer template
This changes only the Workflows-local copy, but the manifest compiler's workflow ownership policy selects templates/consumer-repo/.github/workflows/agents-issue-optimizer.yml for consumer sync; that template still lacks run-name, uses the 20-run default, and filters with contains. Consequently, the sync workflow will continue distributing the ineffective recursion guard to Fine-Art-Archive and the other consumers, leaving the runaway loop this commit targets unfixed there. Mirror these changes into the consumer template before syncing.
AGENTS.md reference: AGENTS.md:L60-L66
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Pull request overview
This PR aims to make the issue-optimizer recursion guard actually count prior runs for a given issue by ensuring workflow runs are correlatable via displayTitle and by tightening the match logic to avoid false positives.
Changes:
- Adds
run-nameto include#<issue>soworkflow_dispatchruns can be correlated viadisplayTitle. - Updates the recursion-guard run correlation from
contains($issue)toendswith($issue)to avoid counting#4640as#464. - Increases
gh run listhistory to--limit 100so tight-loop scenarios aren’t truncated by the 20-run default.
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| run-name: >- | ||
| Agents Issue Optimizer #${{ | ||
| github.event.issue.number || inputs.issue_number }} |
| # window; ask for enough history to actually see the recursion. | ||
| # shellcheck disable=SC2016 | ||
| count=$(gh run list \ | ||
| --workflow=agents-issue-optimizer.yml \ | ||
| --limit 100 \ |
…r template Check Template Drift flagged agents-issue-optimizer.yml as unallowlisted: the root copy carried the fix and the consumer template did not. The template is the copy the fleet's 13 consumer repos actually run, so it needs the same run-name, endswith match, and --limit 100. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Both surfaces changed in this branch, so the stored pair.11 fingerprints no longer match and the drift check reported unallowlisted content. Refresh both hashes and record this round's shared contract in the reason, per the file's existing re-baseline convention. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
Closer audit: this PR's only closing reference is long-closed #464 (closed 2026-01-03); its unresolved acceptance checklist is unrelated to this optimizer-recursion-guard diff. No durable verifier label is being applied against that stale source. Owner decision needed: identify the correct source issue, or authorize this as a no-source maintenance disposition; then the closer can route/verify it safely. |
Closes #464
Automated Status Summary
Scope
Address unmet acceptance criteria from PR #463.
Original scope:
GITHUB_STEP_SUMMARYoutput so iteration results are visible in the Actions UIContext for Agent
Related Issues/PRs
Tasks
agent:codexlabelagents-keepalive-loop.ymlafter agent runbuildStatusBlock()inagents_pr_meta_update_body.jsto acceptagentTypeparameteragentTypeis set (CLI agent): hide workflow table, hide head SHA/required checksagent:*label):<!-- gate-summary: -->comment posting (use step summary instead)<!-- keepalive-round: N -->instruction comments (task appendix replaces this)<!-- keepalive-loop-summary -->to be the single source of truthagent:*label):<!-- gate-summary: -->commentagent_typeoutput to detect job so downstream workflows know the modeagents-pr-meta.ymlto conditionally skip gate summary for CLI agent PRsAcceptance criteria
Head SHA: c49feee
Latest Runs: ✅ success — Gate
Required: gate: ✅ success