Skip to content

fix(queue-stall): clear the stall alert with a reason the platform accepts (#4578) - #4593

Merged
vybe merged 1 commit into
Abilityai:devfrom
pcbeingused333:fix/4578-stall-clear-reason
Nov 17, 2026
Merged

vybe merged 1 commit into
Abilityai:devfrom
pcbeingused333:fix/4578-stall-clear-reason

Conversation

@pcbeingused333

Copy link
Copy Markdown
Contributor

Fixes #4578

Description

The dispatch_queue_stalled alert never ended on its own. queue_stall_service called platform_alerts.clear(..., reason="queue head moved") and reason="queue drained", but platform_alerts.clear forwards reason to ask_service.clear_platform, which only accepts condition_cleared or superseded. The ValueError was swallowed by clear ("never raises"), which returned 0, so the stall row stayed pending after the queue moved on and the sweep summary showed no error.

Both call sites now use the default reason (condition_cleared), as the issue suggests.

Related Issue

Fixes #4578

Journey Impact

Journey Impact: none: bug fix in the stall alert clear path; no journey promise changes

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update

Testing

  • I have tested this locally
  • New tests added (if applicable)
  • All existing tests pass
  • Every new test executes the changed path

New: test_every_clear_reason_is_one_the_platform_accepts in tests/unit/test_4257_queue_stall_monitor.py. It scans the platform_alerts.clear(...) calls in queue_stall_service.py and asserts any literal reason is in ask_service.PLATFORM_ENDING_REASONS. It is a static (AST) check in the style of test_no_clear_site_names_a_person_kind, so it does not execute the clear path; it fails before the change and passes after. The 4257 queue-stall unit tests (monitor and setting) pass; the full suite was not run.

Checklist

  • My code follows the project's style guidelines
  • I have updated the documentation (if applicable)
  • I have not committed any sensitive data (API keys, credentials, etc.)
  • I have added appropriate logging for new functionality

This PR was prepared with AI assistance (Claude Code).

…cepts (Abilityai#4578)

The stall service passed free-text reasons ('queue head moved', 'queue drained') to platform_alerts.clear, which forwards them to ask_service.clear_platform. That only accepts condition_cleared or superseded, so the ValueError was swallowed and the alert stayed pending. Use the default reason and add a test that every clear reason in the service is accepted.
@vybe

vybe commented Nov 17, 2026

Copy link
Copy Markdown
Contributor

merge-train (2026-11-17): on the train as is. Validated at 9f0d3fa8d; the fix is correct and minimal. Two test gaps noted for a follow-up, not blocking: the only assertion that tells fixed from broken is the AST scan (the executing test at test_4257_queue_stall_monitor.py:345-353 stubs platform_alerts.clear and never checks the reason kwarg), and the "queue drained" clear site (queue_stall_service.py:393-395) is executed by no test. Separately, a clear that returns 0 on a known-pending row is still not counted in summary["errors"].

@vybe vybe left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

merge-train: batch validated on train/20261117-1746 (#4626)

@vybe
vybe merged commit 0a71460 into Abilityai:dev Nov 17, 2026
23 checks passed
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.

2 participants