Optimizer recursion guard: stop counting no-op runs - #87
Merged
Merged
Conversation
The guard counted every workflow run whose run-name ended with the issue number, with no filter on whether the run did anything. This workflow triggers on every `issues: labeled` event, but only agents:format, agents:optimize, agents:apply-suggestions and workflow_dispatch get past the trigger check — every other label spawns a run that exits immediately and still consumed one of the four slots. Applying three labels to a new issue therefore burned the whole budget before any optimizer work started, and the guard tripped on legitimate bulk seeding: "Too many optimizer runs (5 > 3) in last hour" on issues that had run the optimizer at most twice. run-name now marks a run [work] or [noop] from the triggering label, which is known at trigger time, and the guard excludes [noop]. Genuine recursion is still caught: four real runs in the window trips as before. Verified against the observed failure — the same history counts 5 (trips) under the old expression and 2 (passes) under the new one, while four work runs still trip. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FC8XoyssN5v6hQCTtcjoB5
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The guard counted every workflow run whose run-name ended with the issue number, with no filter on whether the run did anything. This workflow triggers on every
issues: labeledevent, but only agents:format, agents:optimize, agents:apply-suggestions and workflow_dispatch get past the trigger check — every other label spawns a run that exits immediately and still consumed one of the four slots.Applying three labels to a new issue therefore burned the whole budget before any optimizer work started, and the guard tripped on legitimate bulk seeding: "Too many optimizer runs (5 > 3) in last hour" on issues that had run the optimizer at most twice.
run-name now marks a run [work] or [noop] from the triggering label, which is known at trigger time, and the guard excludes [noop]. Genuine recursion is still caught: four real runs in the window trips as before.
Verified against the observed failure — the same history counts 5 (trips) under the old expression and 2 (passes) under the new one, while four work runs still trip.
Claude-Session: https://claude.ai/code/session_01FC8XoyssN5v6hQCTtcjoB5
Workflow Source
Started from:
Automation intent:
Notes:
Summary
Testing