Skip to content

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
mainfrom
fix/20-continuous-mode-leaks
Open

fix: filter stale labeled events in route to prevent redundant dispatch runs (#20)#21
llm-augmented-workflows[bot] wants to merge 2 commits into
mainfrom
fix/20-continuous-mode-leaks

Conversation

@llm-augmented-workflows

Copy link
Copy Markdown

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

  1. Run the regression test: pytest tests/test_route.py::test_route_skips_stale_labeled_event — confirms stale labeled events are filtered
  2. Run the live-label test: pytest tests/test_route.py::test_route_matches_live_labeled_event — confirms legitimate labeled events still match
  3. Run the full suite: pytest tests/ — all 84 tests pass with no regressions

Acceptance criteria coverage

  • In continuous mode, dispatch runs spawned by the flow's own App-token relabels do not re-execute the matched rule's skill/agent.
  • Event-driven mode still advances phases via relabel-triggered dispatch runs (behavior unchanged).
  • Legitimately (re-)added trigger labels (a revise loop, or a human adding a label) still route and run.
  • A visible signal (label or route output) indicates when an issue is mid-continuous-execution, for observability. — Not addressed in this PR; follow-up issue recommended.
  • docs/flows.md documents the suppression mechanism. — Not addressed in this PR; follow-up documentation PR recommended.

References


Created with create-pr via deepseek-v4-flash-free (6546623)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Continuous mode leaks redundant dispatch runs via App-token relabels

0 participants