Skip to content

ci(evals): refuse an opted-in compare run when the subscription account's weekly headroom is low #18235

Closed as not planned

Description

@kyle-sexton

Context

With the org's API key disabled (CLAUDE_API_KEYS_DISABLED=true since 2026-11-19), a required compare-mode eval run can opt in to the maintenance subscription token (#18234). The owner's condition on that (2026-11-22): runs must not "blow through our remaining usage." For now #18234 guards this with a hard cap: an opted-in dispatch is refused above cost-cap-usd 5 per pass. That cap is a list-price estimate and cannot see how much weekly usage the account has left.

The only usage reader found is in claude-code-account-rotation, which calls https://api.anthropic.com/api/oauth/usage (src/ClaudeCodeAccountRotation.App/Adapters/Http/AnthropicEndpoints.cs:15). That endpoint is undocumented. Whether a CI CLAUDE_CODE_OAUTH_TOKEN (a setup token) is allowed to call it is UNVERIFIED.

Proposed work

  • Confirm the endpoint's current behavior and response fields, and whether a setup token's scope can read it: one read with the maintenance token in a dispatch job, printing only the utilization numbers, never the token.
  • If it can: add a pre-step to the opted-in compare passes that reads weekly utilization before any agent run, and refuses above a threshold held in a repository variable (default 80%).
  • If it cannot: record that here, keep the 5 USD per-pass cap as the guard, and close.

Acceptance criteria

References

Activity

  1. added
    session-owned
    on Nov 22, 2026
  2. kyle-sexton commented on Nov 23, 2026

    @kyle-sexton
    MemberAuthor

    Moot: #18268 removed every subscription and fallback eval leg, so no eval path reads a subscription token and a subscription headroom pre-step has nothing to guard. Evals run on the maintenance API key alone (owner decision Q14) under docs/review/evals.md (#18269).

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

    session-owned

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions