Skip to content

Estimate the GitHub requests per hour that scheduled Passes make, per quota owner across the Fleet #1998

Open

Description

@JacobStephens2

This was generated by AI during triage.

Follow-up to #1969 (Fleet cron schedules by repository and machine, in progress as PR #1987). It builds on that Fleet view. Quota evidence is on #739. Reducing the requests themselves is #1992.

Problem

All Fleet machines authenticated as one GitHub user share that user's 5000/hr REST quota. On 2026-11-10, six machines scheduled ~840 Pass starts/hr. That exhausted the quota and failed #1968's Ticket run during CI watching. Nothing in thirdshift shows how much of the quota the schedules use; the total had to be worked out by hand from six crontabs.

Desired behavior

Using the repository → machine → Command kind inventory from #1969, show an estimated GitHub request rate for the scheduled Passes:

  • For each recognized entry, derive Pass starts per hour from its cron schedule. Support at least *, */n, a-b/n, lists, single values and @hourly/@daily across the minute and hour fields. A schedule that can't be evaluated, or that restricts day-of-month, month or day-of-week, is not estimated rather than approximated or counted as zero.
  • Multiply by a fixed per-Pass request estimate for the Command kind, split into REST and GraphQL, kept in one documented place. Each value says whether it was measured or derived from code.
  • Show subtotals per machine and per repository. The headline is per GitHub quota owner (the authenticated login and GitHub host each machine reports), summed across the Fleet. Show it against the 5000/hr REST limit, with GraphQL separate. Machines that can't be reached are excluded and named.
  • Label the figures as floors for Passes that find nothing to do. A Pass that starts a run uses far more (CI watching, Claims, agent sessions). Skips at the Command limit are free.
  • thirdshift cronjobs --json, the page and the Console API agree (ADR 0026).

Measured per-Pass costs (2026-11-10)

Hand-run on Lima under a pass-through gh counter (GH_DEBUG=1, one line per HTTP request). stephens.page, with nothing to do:

Pass REST GraphQL Requests seen
Pickup 4 2 closed in-progress, closed agent-failed, open agent-failed, open ready-for-agent issue lists; 2 GraphQL Ready checks
Triage 4 0 the same three Sweep/accounting lists + open needs-triage
Review 2 + 1 per candidate PR 0 open PRs, /user, comments on one PR
Fix 0 0 stopped at "Base branch CI is reserved on origin" (git, not GitHub); other paths not measured
Architect, Secure not measured
Any Pass skipped at the Command limit 0 0 all ten Pass kinds × 2 repos, checked

Each --paginate list counts one request per page, so large repositories cost more. Agent sessions add ~3–7 gh calls per run (14 days of Session traces, all hosts: Pickup ~6.5, Triage ~5.3, Architect ~3.1, Secure ~3.2, Fix ~2.5, Review ~0.9 per run).

Example acceptance criteria (to confirm when shaping)

  • */2 gives 30 starts/hr, 1-59/10 gives 6, 20 * * * * gives 1, 0 1,5,6 * * * gives 3/24. A day-of-week-restricted or unparseable schedule shows as not estimated.
  • With the table above, a Pickup entry at */2 shows 120 REST + 60 GraphQL per hour. Totals per repository, per machine and per quota owner add up exactly.
  • Two fake Fleet machines on the same GitHub login add up into one quota-owner total. A third machine on a different login is totalled separately.
  • The page and CLI say the figures are floors for Passes that find nothing to do.

What a person needs to do first

Out of scope

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions