chore: remove unused background task queue subsystem - #43
Merged
Conversation
The task queue (in-memory + Redis backends, retries, dead letters, adaptive auto-requeue, worker heartbeats), its /tasks* admin endpoints, remediation playbooks, and the PagerDuty client were infrastructure without a workload: grep confirmed enqueue() was only ever called from tests, and the real workload engine (scheduler/procedure_runner) never touches the queue. Remove the queue, its Redis storage, playbooks, PagerDuty client, queue-health dashboard helper, queue-only Prometheus metrics, the task_queue_*/pagerduty_*/redis_url settings, redis/fakeredis dependencies, the redis docker-compose service, and the dedicated tests. Connector sync records (/sync/status) and the procedure scheduler are separate live features and stay.
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.
Summary
The repo shipped a full background task-queue subsystem (in-memory + Redis backends, retries, dead letters, adaptive auto-requeue, worker heartbeats, remediation playbooks, PagerDuty escalation,
/tasks*admin endpoints) that nothing in the application uses — grep confirmsenqueue()was only ever called from tests. The actual workload engine (scheduler.py/procedure_runner.py) never touches the queue, so this was pure operational surface area: ~2,100 lines of code, 18 settings knobs, a Redis dependency, and a docker-compose service with no callers.Deleted (grep-verified as queue-only):
agent_pm/storage/tasks.py,agent_pm/storage/redis.py— queue + Redis state/dead-letter storageagent_pm/tasks/playbooks.py— remediation playbooks (only called from the queue worker)agent_pm/clients/pagerduty_client.py— only used by playbooksagent_pm/observability/dashboard.py— queue-health helper, only fed/tasks/health/tasks*endpoints and queue startup/shutdown wiring inapp.pytask_queue_*,task_dead_letter_*) inobservability/metrics.pytask_queue_*(18 knobs),pagerduty_*, andredis_urlsettings (redis_urlwas only read by the deleted Redis storage)redis/fakeredisdependencies (fakerediswasn't even imported anywhere),uv lockregeneratedredisdocker-compose service +REDIS_URL/TASK_QUEUE_BACKENDenv wiringtests/test_tasks_api.pywhich only exercised the deleted endpointsKept (live, separate features):
agent_pm/tasks/sync.py+agent_pm/storage/syncs.py— connector sync records behind/sync/statusagent_pm/scheduler.py+agent_pm/procedure_runner.py— the actual cron/procedure engineclients/slack_client.py— used by procedurestests/storage/test_database.py— remains, so the CIstorage-testsjob is unchanged and still justifiedTest plan
uv run ruff check .— passuv run ruff format --check .— passuv run mypy agent_pm— pass (67 files)uv run pytest -q— 120 passeduv.lockhistory