Files
ai-artifacts/projects/dotfiles/062-pi-ui-quota-status-prototype.md
2026-08-01 14:05:09 -04:00

2.5 KiB

status, claimed-by, claimed-at, parent, blocked-by, resolved-at, tags
status claimed-by claimed-at parent blocked-by resolved-at tags
resolved 019fba91-eabf-76ae-b086-a37ac061d6e8 2026-08-01T01:10:00-04:00 057-pi-ui-customization-map
2026-08-01T08:10:00-04:00
ticket/prototype/hitl

Codex quota status prototype

Question

If quota research finds a reliable data source, extend the throwaway status prototype with a quick way to inspect remaining weekly ChatGPT Codex quota and have the user judge whether the interaction belongs in the compact status surface.

Prototype build

The throwaway compact status extension now reads Pi's local openai-codex OAuth credential from ~/.pi/agent/auth.json, calls first-party ChatGPT/Codex usage endpoints, parses quota windows defensively, and caches only normalized non-secret percentages in memory. It does not log or display tokens, account ids, or raw response bodies.

The compact status widget now renders context usage and Codex weekly quota as unlabeled stacked thin bars. The context row uses the lower three-eighths block glyph after HITL comparison. The Codex row remains an upper one-eighth bar because upper-aligned block characters have less granularity. Codex quota is inverted: it fills as quota is consumed rather than as quota remains. The quota color uses the theme border blue below 50% consumed so it contrasts with the green context bar, then yellow at 50% and red at 80%. HITL verdict is positive.

Example shape:

󰉋 ~/dotfiles 󰘬 main                                             gpt-5.5 • medium
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀──────────────────────────────────────────────────────────

The /codex-quota notification may still include normalized percentage details for inspection.

A command is available:

/codex-quota

It forces a refresh and shows a notification with the normalized quota summary or a non-secret error.

Verification

A tmux smoke test launched the flex-spacer prototype and confirmed the status line rendered live quota data:

codex W 94% S 94%

The visible prototype was then changed after HITL feedback to a one-row half-block bar instead of separate context and quota rows.

The prototype remains at:

/home/alexion/.pi/agent/extensions/compact-status-prototype.ts

Launch with the flex-spacer Pi prototype for the combined visual test:

/home/alexion/.local/share/pi-flex-spacer-prototype/pi-flex-spacer