fix: filter stale labeled events in route to prevent redundant dispatch runs (#20)#21
Open
llm-augmented-workflows[bot] wants to merge 2 commits into
Open
fix: filter stale labeled events in route to prevent redundant dispatch runs (#20)#21llm-augmented-workflows[bot] wants to merge 2 commits into
llm-augmented-workflows[bot] wants to merge 2 commits into
Conversation
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.
What
Adds a staleness guard in route.py that filters out labeled events whose trigger label is no longer present on the issue's live label set.
Why
In continuous mode, App-token relabels chain the flow forward but also schedule queued dispatch runs via the concurrency group. When those queued runs execute, they match rules based on the event payload label (which is fixed at trigger time) rather than the issue's current labels. Since continuous mode consumes each trigger label before proceeding, the queued runs match stale labels and re-invoke agents wastefully.
The fix checks whether the trigger label is still present on the issue's live label set (from payload.issue.labels) before allowing a match. This is the same approach as option 2 in the issue description.
How to test
pytest tests/test_route.py::test_route_skips_stale_labeled_event— confirms stale labeled events are filteredpytest tests/test_route.py::test_route_matches_live_labeled_event— confirms legitimate labeled events still matchpytest tests/— all 84 tests pass with no regressionsAcceptance criteria coverage
References
Created with create-pr via deepseek-v4-flash-free (
6546623)