Watch
0
0
Fork
You've already forked hyperhive
0
hyperhive/docs/scheduler
Repository files (latest commit first)
Filename Latest commit message Latest commit date
atlas 8a735ddcb3 hive-agent: publish Claude subscription usage (5h/7d %) as metrics
A detached task polls GET https://api.anthropic.com/api/oauth/usage every
5 minutes with the OAuth access token from ~/.claude/.credentials.json and
records, per window the response names (five_hour, seven_day,
seven_day_sonnet, ...):

- hyperhive.agent.claude_usage.percent   (%, 0-100)
- hyperhive.agent.claude_usage.resets_at (s, unix seconds)

both labelled window=<name>. Endpoint, the anthropic-beta:
oauth-2025-04-20 header and the {utilization, resets_at} window shape are
taken from the claude-code 2.1.283 bundle's own /usage fetch.

The token is only read, never refreshed: claude owns refresh-token
rotation and a second refresher can log the agent out. An expired token
is skipped until claude's next turn refreshes it. API-key agents
(HIVE_USE_API_KEY, the ACP default) and agents with no credentials file
skip quietly, and the task does nothing when OTEL is not configured.
Request failures and non-2xx statuses warn with the status or transport
error only, never the body or the token.
2026-09-30 20:53:03 +02:00
..
ci.md swarm-controller: own the swarm-wide forge objects; hive-c0re stops creating them 2026-09-25 08:36:05 +02:00
coordinator.md Make agent creation swarm-only and refuse a name placed on another hive 2026-09-29 15:47:40 +02:00
jobq.md docs: suppress reviewed write-good.Passive false positives 2026-09-20 16:24:11 +02:00
observability.md hive-agent: publish Claude subscription usage (5h/7d %) as metrics 2026-09-30 20:53:03 +02:00