Skip to content

fix(service): a restart keeps the halt, the budget window and the failure ledger, and a secondary limit or a suspended installation stops every worker #2474

Description

@dan-petty

Problem or Motivation

A go-live review of the roadmap Service (origin/main 960e357, 2026-10-28) found three gaps in how it stops when GitHub pushes back:

  • A restart clears the halt, the budget window and the failure ledger (src/devops_cli/server/service.py:130-134, :225-248; src/devops_cli/roadmap/run.py:591-631). A crash or a manual restart after a refusal starts again at full speed against GitHub.
  • A secondary rate limit pauses only the thread that met it; the other workers go on (src/devops_cli/commands/serve.py:180-187; commit 84f02a1 removed the Service-wide pause reader).
  • A suspended installation whose current token is still valid does not halt the Service, and a 403 with no rate-limit headers is not read as a refusal (src/devops_cli/config/constants.py:865-871; src/devops_cli/github/error_classifier.py:193-227).

GitHub suspended the previous identity on 2026-10-11 (#1562). Repeated requests after a refusal are the behavior most likely to make GitHub block the App.

Proposed Solution & Architectural Design

  • The halt, the hourly budget window and the failure ledger live on the PVC roadmap-service-home, beside the schedule, and a restart reads them back.
  • A secondary-limit refusal pauses every worker until its retry-after ends.
  • A reply that says the installation is suspended, or a 403 with no rate-limit headers on a write, halts the Service with identity_refused.

Target Subsystem

Roadmap Service (src/devops_cli/server/, src/devops_cli/roadmap/run.py, src/devops_cli/github/).

Existing Tool Considered

The Service's own halt, budget and ledger code, and GitHub's documented retry-after and x-ratelimit-* headers. Nothing new is built; the change moves existing state to the existing volume.

Acceptance criteria

  • A test restarts the Service over a fake volume and finds the halt, the budget window and the ledger as they were.
  • A test sends one secondary-limit 403 with retry-after to one worker and finds every worker paused.
  • A test sends "installation has been suspended" and a header-less 403 on a write, and finds the Service halted.

Activity

  1. added
    source/agent
    type/bug
    status/new
    value/high
    effort/medium
    on Oct 28, 2026
  2. dan-petty commented on Oct 28, 2026

    @dan-petty
    OwnerAuthor

    Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones.

    • Type: type/bug. The title is prefixed fix and the body describes three incorrect behaviours in the Service stop logic.
    • Priority: P1-High. Repeated requests after a refusal risk GitHub blocking the App again, and the Service must be safe before it returns to one replica. The regression commit 84f02a1 does not set P0: the author has no write access, and no caller attached it as evidence. A person can set P0 with the label priority/p0-critical.
    • Value: High. Preventing a second GitHub App suspension protects the entire project's automation.
    • Effort: Medium. Three targeted fixes to existing code paths, with no new components, but each needs a test and the PVC persistence touches multiple files.
    • Related: feat(cli): correct secondary-limit backoff and retry-after handling in run_gh #705, which asks for a different change. Both handle secondary-limit and retry-after, but #705 fixes the CLI rate-limiter backoff while the candidate pauses all Service workers and adds halt recognition.
  3. added
    priority/p1-high
    on Oct 28, 2026
  4. added a commit that references this issue on Oct 28, 2026
    3630de1
  5. removed
    status/new
    on Oct 30, 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

    effort/mediumpriority/p1-highsource/agenttype/bugvalue/high

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions