feat(macos): overage + límite vinculante + estado global en la app de barra de menú - #2
feat(macos): overage + límite vinculante + estado global en la app de barra de menú#2crilam wants to merge 2 commits into
Conversation
… BLE Monitor de uso de Claude Code como NSStatusItem: lee el token OAuth del Keychain y los headers anthropic-ratelimit-unified-* de la API (misma fuente que el daemon), sin dispositivo físico ni Bluetooth. Popover con medidores 5h/7d, colores por umbral y cuenta regresiva de reinicio. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…global Parsea los headers unified-overage-*, representative-claim y unified-status. Popover: tercer medidor "Overage" (color propio, permite >100%), motivo de bloqueo (p.ej. org_spend_cap_reached), tag "límite actual" en la ventana que aprieta (5h/7d) y punto de estado global con color por allowed/warning/rejected. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
Caution Review failedAn error occurred during the review process. Please try again later. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 53d1b81816
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| } | ||
| } | ||
|
|
||
| if let usage = store.usage { |
There was a problem hiding this comment.
Surface refresh failures when cached usage exists
After the first successful poll, usage remains non-nil when a later refresh fails because UsageStore.refresh() only sets lastError. This branch therefore continues showing the cached meters instead of the error, while main.swift also suppresses the ! indicator whenever cached usage exists; an expired token or prolonged network outage can consequently leave an arbitrarily stale percentage displayed with no failure indication. Retain the last snapshot if desired, but surface its stale/error state.
Useful? React with 👍 / 👎.
Qué agrega
Amplía la app de barra de menú con los tres indicadores
unifiedque faltaban (todos desde la misma fuente OAuth, sin nueva credencial):unified-overage-utilization), con color propio (púrpura <100%, rojo ≥100%) y soporta >100%. Solo se muestra si es relevante.unified-overage-disabled-reason), p.ej.org_spend_cap_reached→ texto legible.unified-representative-claim: 5h vs 7d).unified-status) con punto de color allowed/warning/rejected.Contexto
Se evaluó exponer límites por-modelo (Fable, Opus) o por-feature (Claude design): no es posible desde el feed de suscripción de Claude Code — el bucket
unifiedagrega todos los modelos. Los límites por-modelo solo existen en la API de desarrollador (/v1/organizations/rate_limits, requiere Admin key) y no reflejan el uso del plan Max.Verificación
swift build -c releaselimpio.org_spend_cap_reached, representative-claimfive_hour.🤖 Generated with Claude Code