Skip to content

Add count_unclaimed_ready_tasks function#84

Open
Aaron1011 wants to merge 1 commit intomainfrom
aaron/count-unclaimed
Open

Add count_unclaimed_ready_tasks function#84
Aaron1011 wants to merge 1 commit intomainfrom
aaron/count-unclaimed

Conversation

@Aaron1011
Copy link
Member

@Aaron1011 Aaron1011 commented Mar 17, 2026

We can use this to monitor our running autopilot queue, and alarm if a large number of tasks are persistently unclaimed


Note

Low Risk
Additive SQL function and client wrapper with new tests; low risk aside from potential performance impact of the count query on large queues.

Overview
Adds a new Postgres function durable.count_unclaimed_ready_tasks(queue) that returns the number of runs that are ready to be claimed (matching claim_task candidate eligibility but without locking/updating).

Exposes this via a new Rust client method Durable::count_unclaimed_ready_tasks, and includes a migration plus integration tests covering empty queues, multiple queues, worker-claim depletion, and excluding runs scheduled in the future.

Written by Cursor Bugbot for commit 605e96d. This will update automatically on new commits. Configure here.

We can use this to monitor our running autopilot queue,
and alarm if a large number of tasks are persistently unclaimed
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