Skip to content

Threshold evaluation and date-sensitive Agent SDK credit meter handling #33

Description

@Ryan-Atkinson87

Evaluate a UsageSnapshot against the pause threshold and select the meter to govern on,
including the date-sensitive Agent SDK credit handling.

Spec: §6.3 (Threshold rule), §6.6 (Agent SDK credit change — date-sensitive). Config:
§16.3 usage.threshold_percent (default 80).

Acceptance criteria

  • Threshold evaluation: returns whether the governing meter has reached the threshold (default 80%, read from project.yaml usage.threshold_percent).
  • No model downgrade is ever proposed to keep running (Spec §6.3 — quality is not compromised); the only lever here is "reached / not reached" feeding pause (Hard pause and two-tier automatic resume (reset-known sleep + backoff probe) #34) and cap-stepping (Concurrency cap step-down as usage lever (3 to 2 to 1 to pause) #35).
  • Agent SDK credit (§6.6): from 15 June 2026, on subscription plans the Agent SDK / claude -p usage draws from a separate monthly Agent SDK credit. Treat it as its own meter and target the correct meter for "reserve capacity for the human" (chat pool vs SDK credit) by provider/plan/date.
  • Exposes which meter is currently governing (consumed by the UI surface in Provider/plan switch meter reload and wave-loop monitor integration #37).
  • Date logic is explicit and testable (injectable clock) — the 15 June 2026 cutover is covered by tests on both sides of the date.
  • Unit tests cover: governing meter below/at/above threshold, a custom threshold_percent, and SDK-credit-vs-chat-pool targeting before and after the cutover.

Depends on: #30
Depends on: #4

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions