Skip to content

fix(roadmap): a GraphQL budget refusal pauses every Service worker until the reset, and each Service round ends with its spend line #1400

Closed

Description

@dan-petty

Problem

Split from #1361, whose store fix delivers the board-write cost. The machine account's 5,000-point GraphQL budget is shared by every repository worker in the roadmap Service, yet a budget refusal stops only one round, and the next round starts at once:

  • 34 refused rounds between 22:44 and 23:06Z on 2026-10-07, each spending a point;
  • 88 failed and 0 successful rounds for this repository in the 6 hours to 2026-10-08 05:00Z.

Nothing reports a round's spend either. GraphQLSpend.line prints only from devops roadmap commands, and Prometheus has no quota series.

Acceptance criteria

  • require_budget, require_floor and require_write_floor put the reset time in the error's details.

  • The Service takes the earliest reset from a failed round:

  • Only a refusal that carries a reset pauses. fix(github): a gh call at a quota window's reset waits out the reset second instead of failing as unknown or broken state #1364's state errors pause nothing.

  • After such a round, ServiceManager starts no round for any repository before the reset. It logs the wait once, with the time, and runs the triggers that arrive meanwhile as one round per repository after the reset.

  • Every round that sends a GraphQL request ends with a spend line that names the repository and says the points are the account's. A round that sends none logs no line and sends no budget query.

  • Tests:

    • tests/test_server_service.py with a fake clock, for a refusal from changes_since and for a job-level refusal; a second repository's worker starts nothing before the reset;
    • tests/test_roadmap_run.py for the spend line.

    Tests are offline, each call phase stays under 1 s, and uv run devops ci passes. changelog.d/<n>.md records the change.

  • Pending a person, after the Service runs a release with this fix: during a refusal, Loki shows one wait line per reset and no failed rounds until it. Each round's spend line appears.

Strategic alignment


Filed directly with no priority; the roadmap service's intake sets Priority, Value and Effort.

Update 2026-10-08: delivered scope

Activity

  1. added
    type/bug
    scope/github
    source/agent
    on Oct 8, 2026
  2. dan-petty-bot commented on Oct 8, 2026

    @dan-petty-bot
    Collaborator

    Intake placed this item to the backlog: at intake only a critical fix goes into a release; a release start pulls Ready items in, P0 features first.

    • Priority: P1-High. The shared 5,000-point budget is exhausted within hours, leaving the service with 0 successful rounds and no way to recover until the next window, blocking all roadmap work across every repository.
    • Value: High. Without this fix the roadmap service is non-functional during any budget exhaustion and silently burns the shared account's quota, affecting every repository it serves.
    • Effort: Medium. Requires threading reset times through three budget-check functions, adding pause logic to ServiceManager across repositories, emitting a spend line per round, and writing offline tests with a fake clock.
  3. added this to the v0.2.29 milestone on Oct 8, 2026
  4. dan-petty commented on Oct 8, 2026

    @dan-petty
    OwnerAuthor

    Placed in v0.2.29 by the owner on 2026-10-08. The owner's instruction was to pull every issue that keeps the roadmap service from working into the current milestone and complete them. This is a person's placement and should stay in the release (#1349). Implementation started the same day, so the board Status is In Progress.

  5. dan-petty-bot commented on Oct 8, 2026

    @dan-petty-bot
    Collaborator

    What changed

    #1445, merged into release/v0.2.29 as 010f020.

    Closes #1400

    A GraphQL budget refusal in one roadmap Service round now holds every repository's rounds until 5 s after the reset it names, and each round that sent GraphQL ends with one spend line naming its repository.

    What changes

    22 file(s) changed.

    How it was verified

    Check runs at 0ba7daa:

    • Prune PR DevContainer Images: pass
    • CodeQL: pass
    • Static Analysis: pass
    • Analyze (actions): pass
    • Tests & Coverage: pass
    • Analyze (python): pass
    • DevContainer Image: skipping
    • Service Image: skipping
    • Dependency Freshness: skipping

    Acceptance Criteria of docs/agent/tasks/task-1400-graphql-refusal-pauses-service.md:

    • require_budget, require_floor and require_write_floor put the reset time in the error's details, and the store's refused read carries the reset GraphQL reported (test_each_refusal_carries_its_budgets_reset_in_its_details).
    • The Service takes the earliest reset from a failed round:
      • from the error itself when the refusal comes from outside a job (test_a_refused_read_of_the_changes_leaves_the_round_with_the_reset);
      • from the failed jobs' refusals through RoadmapRunError.reset_at, while the next job still runs (test_a_jobs_refused_write_fails_the_round_with_the_reset_and_the_next_job_still_runs).
    • Only a refusal that carries a reset pauses (test_an_error_that_is_not_a_budget_refusal_names_no_reset, test_an_error_that_names_no_reset_holds_no_round). These hold nothing and log no wait:
    • After such a round, ServiceManager starts no round for any repository before the reset plus the 5 s bound, for a refusal from changes_since and for a job's refused write (test_a_budget_refusal_holds_every_repositorys_rounds_until_the_reset[changes_since], [job]).
      • Triggers arrive for both repositories 10 minutes before the reset and 4 s after it.
      • The wait is logged once with the time.
      • After it, each repository runs one round holding every trigger.
      • Two workers refused for one reset log one line, and the next hour's reset logs its own (test_every_worker_refused_for_one_reset_logs_one_wait_line).
    • A drain during a pause returns well within the drain timeout with the workers ended, and the held rounds never run (test_a_drain_during_a_pause_stops_the_workers_without_running_the_held_rounds).
    • Every round that sends a GraphQL request ends with a spend line naming the repository and saying the points are the account's.
      • A round that sends none logs no line and sends no budget query (test_a_round_that_sends_graphql_ends_with_one_spend_line_naming_its_repository, test_a_round_that_sends_no_graphql_logs_no_spend_line_and_reads_no_budget, test_the_spend_reads_no_budget_until_the_store_sends_a_graphql_request).
      • Through service_job, a refused round still ends with the line, from the refusing budget with no closing budget read, and raises the refusal unchanged (test_a_service_round_ends_with_its_spend_line_however_it_ends).
      • A closing read that fails with any class of error is a warning naming the class, and the round's own error stands (test_a_budget_the_round_cant_read_is_a_warning_and_the_rounds_own_error_stands).
    • devops serve --service passes the reader to the Service (test_service_wiring).
    • The dry-run plan of a close with no open release still matches a run that sends no GraphQL request (test_a_close_with_no_open_release_sends_no_graphql_and_skips_its_plans_budget_read).
    • Tests are offline. The service tests use an injected clock and injected jobs. The run tests use GitHubFake at the store's runner seam, with every interval job's schedule seeded, so no real gh, metrics or HTTP status read runs. Each new test's call phase stays under 1 s, and uv run devops ci passes.
    • changelog.d/1400.md records the change; CHANGELOG.md and docs/ROADMAP.md are untouched.
    • Pending a person: once the Service runs a v0.2.29 image with this fix, check the next GraphQL refusal.
      • {namespace="devops", container="service"} |= "No repository starts a Service round before" shows one line per reset.
      • Take T0 as the epoch of that line and T1 as the epoch of the time it names. max by (repo) (max_over_time(devops_cli_service_job_start_timestamp_seconds[<T1-T0>s] @ <T1>)) is below T0 for every repository, so no round started during the pause.
      • Failures of rounds already running when the pause began are expected and don't count.
    • Pending a person: on the same rollout, sum by (repo) (count_over_time({namespace="devops", container="service"} |= "of the account's points" | json [1h])) is non-zero for every managed repository whose rounds read the board in that hour.
  6. added a commit that references this issue on Oct 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    scope/githubsource/agenttype/bug

    Type

    No type

    Projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions