Skip to content

Headroom predicates never read overage_status / unified_status — a subscription serving on overage may be mis-badged; capture the first real overage header set #2865

Open

Description

@webmixgamer

Summary

services/subscription_headroom_service.py::parse_unified_headers parses and persists overage_status (anthropic-ratelimit-unified-overage-status) and unified_status (anthropic-ratelimit-unified-status), and subscription_headroom_history stores both — but no predicate reads either. _headroom_indicates_limited / _headroom_indicates_healthy, classify_headroom, headroom_reading and the #2409 ranker key on the per-window -status values, the probe's HTTP status and the utilization figure only.

The provider's own client derives "serving on overage" as unified-status == rejected together with overage-status ∈ {allowed, allowed_warning}. So a subscription that has run past its cap and is being served on overage may report a top-level rejected while still serving requests. How Trinity's per-window predicates read that state is unknown: depending on what the per-window -status values carry during overage, such a subscription is either LIMIT-badged / saturated / dropped as refused everywhere while it is in fact serving, or its overage is invisible.

Context

Surfaced by the independent strategy review of #2419 (PR #2864), which fixed the utilization figure for readings past 1.0 but deliberately did not touch the status predicates. No overage header set has ever been captured: every local plan carries overage_status = rejected (blocks at 100%), so the questions "does 5h/7d utilization exceed 1.0 on overage?" and "what do the per-window statuses say during overage?" are both open.

#2864 added the capture path: _probe logs [#2419] subscription … reports utilization past its cap at INFO with the raw header strings (5h/7d utilization, overage-status, status, representative-claim) the first time a window reads past 100%. Standing query for the persisted side:

SELECT * FROM subscription_headroom_history
WHERE five_hour_utilization_pct > 100 OR seven_day_utilization_pct > 100;

Acceptance Criteria

Technical Notes

Activity

  1. added
    priority-p3
    type-bug
    theme-monetization
    complexity-medium
    status-ready
    on Sep 17, 2026
  2. added a commit that references this issue on Sep 17, 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

    complexity-mediumpriority-p3status-readytheme-monetizationtype-bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions