DEV Community

Agent Island
Agent Island

Posted on • Originally published at agent-island.dev

Do Not Invent a 5-Hour Window in a Codex Usage Tracker

An old quota tile can keep looking correct long after the provider stops reporting the data behind it.

Codex currently exposes a weekly usage window. It does not expose the former five-hour window. Keeping a permanent "5h" card in the interface would turn stale product history into current telemetry.

Render the period returned by the provider

The primary tile should describe the weekly window and its reset time. The layout can expand when only one period exists instead of preserving an empty second slot.

Do not hardcode the label from a previous API response shape:

bad:  tile.title = "5h"
good: tile.title = providerPeriodLabel
Enter fullscreen mode Exit fullscreen mode

The percentage may be displayed as used or remaining. Either way, it answers one question: how much weekly capacity is left?

Give Codex its own freshness state

A combined Claude and Codex dashboard still needs separate provider state.

If Claude refreshes successfully while Codex fails, a single green "updated" status hides the Codex failure. Each provider needs its own value, error, and refresh timestamp.

Persisted values can prevent an empty screen during startup, but loading old data must not refresh its age. Show the last successful sync and the provider-specific error.

Keep quota and tokens separate

Codex session records can contain token usage events. A local ledger can parse them, separate input, output, and cached-token categories, and deduplicate records that reappear during later scans.

The event timestamp controls daily and weekly attribution. The scan timestamp only tells us when the record was observed.

This local ledger does not explain the provider quota percentage one for one. Provider rules and local log coverage have different boundaries.

Unknown models stay unpriced

For recognized model identifiers, a dated price snapshot can produce estimated API value. Unknown models should remain unpriced instead of inheriting the rate of a convenient neighbor.

The estimate is not subscription spend. Included usage, price changes, missing events, and provider-side aggregation prevent exact reconciliation.

A short evaluation checklist

Ask these questions before trusting a Codex usage tracker:

  • Does it show the current weekly window without inventing a five-hour one?
  • Are Codex errors and freshness independent from Claude?
  • Does the local ledger deduplicate replayed events?
  • Are unknown models visibly unpriced?
  • Is estimated API value separate from actual billing?

I help run Agent Island. The Codex weekly window, local ledger, and report behavior described here is verified on macOS in v1.7.1. This is not a Windows-parity or Codex quota-alarm claim.

The canonical guide contains the full data-boundary discussion:

Track Codex weekly quota and local token activity

Top comments (0)