fix(ai-usagebar): clarify quota limits and reset times - #667
Merged
ItsLemmy merged 26 commits intoSep 8, 2026
Conversation
…ep model glyphs neutral
Redact quoted diagnostic values and sensitive headers completely. Inspect JSON field names before publishing report data to plugin state. Preserve numeric token counts and cover the redaction gaps with tests.
There was a problem hiding this comment.
🟢 Approval recommended
The changes are cohesive with the stated goals (quota/reset clarity + redaction hardening) and are supported by expanded targeted Lua test coverage across shared, bar, panel, and scrub logic.
Pull request overview
Updates the felipeartur/ai-usagebar plugin to v2.2.0 to improve how quota exhaustion/reset timing is communicated, refine provider/model presentation in the bar + panel, and strengthen diagnostic redaction before publishing CLI output into plugin state.
Changes:
- Improve quota “headline” selection (incl. exhausted-window reset selection) and group Antigravity limits by model in both bar and panel UI.
- Filter providers with unusable readings (while keeping schema/parser failures visible with a missing-value indicator) and refine the panel’s master/detail layout.
- Harden redaction logic for quoted secrets, headers, and sensitive JSON fields; expand/adjust Lua test coverage accordingly.
File summaries
| File | Description |
|---|---|
| ai-usagebar/translations/en.json | Updates English setting/help strings and adds quota exhaustion/reset copy used by the panel. |
| ai-usagebar/tests/shared_test.lua | Expands shared behavior tests for availability filtering, ordering, bottleneck selection, and model headline logic. |
| ai-usagebar/tests/scrub_test.lua | Adds additional secret/header and structured-field redaction test cases. |
| ai-usagebar/tests/panel_test.lua | Updates/expands panel rendering tests for provider filtering, model grouping, stale behavior, and exhausted-quota notices. |
| ai-usagebar/tests/bar_test.lua | Updates/expands bar rendering/tooltip tests for bottleneck selection, model glyphs, countdown formatting, and filtering. |
| ai-usagebar/shared.luau | Adds transport/auth classifiers, “read failure” exception handling, fixed countdown formatting, and model/headline selection + sorting. |
| ai-usagebar/service.luau | Strengthens redaction patterns (quoted secrets, authorization/cookie headers) and adds structured-field scrubbing rules. |
| ai-usagebar/README.md | Aligns documentation with the new behavior (quota exhaustion/reset semantics, provider filtering, UI behavior, redaction notes). |
| ai-usagebar/plugin.toml | Bumps plugin version to 2.2.0 and adjusts panel dimensions. |
| ai-usagebar/panel.luau | Updates panel visuals/layout, filters transport-detail noise from cards, adds exhausted-quota notices, and supports model grouping. |
| ai-usagebar/bar.luau | Updates capsule rendering/tooltip to reflect bottleneck/exhaustion logic, model grouping, and missing-data behavior for parser failures. |
Review details
- Files reviewed: 11/12 changed files
- Comments generated: 0
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Plugin
felipeartur/ai-usagebarplugin.toml)What it does
Updates AI Usage to 2.2.0 with clearer quota readings in the bar and panel.
100%, it uses the latest reset. Critical severity below 100% remains a warning,
not a block.
Model icons, values and colors respect the widget settings.
visible with a missing-value indicator and diagnostic.
Exhausted quotas get a compact notice. Codex reset credits show their type and
expiry on separate, wrapping lines.
unchanged.
The security review found and fixed gaps in diagnostic redaction. Quoted
sensitive values now remove the rest of the line, including escaped or
truncated values. Authorization and cookie headers are redacted, and sensitive
JSON fields are scrubbed before publication to plugin state. Numeric token
counts retain their values and types. This is pattern-based protection, not a
guarantee that arbitrary CLI output contains no private information.
External dependencies
ai-usagebar, declared inplugin.toml. One service runs the fixed commandai-usagebar usage --jsonon the configured interval or a refresh request.Requests are coalesced, with a 30-second process timeout.
The CLI owns provider requests, credentials and caching. The plugin does not
make network requests or write files. It reads the process output, scrubs text,
and publishes the report to Noctalia plugin state for the bar and panel.
The installation address is plain text; the plugin no longer spawns
xdg-open.Testing
v5.0.1 (5.0.1-1-dirty)22Tested with the official ai-usagebar 1.12.0 package. Opened the Codex and
Antigravity panels, selected providers through IPC, refreshed the report, and
checked quota cards and countdowns in the current dark theme. Other themes and
display scales have not been visually tested.
The five Lua suites pass. They cover credential-pattern redaction, refresh
coalescing, malformed data, provider/account selection, exhausted-window reset
selection, Antigravity settings, parser failures, reset-credit layout and
timestamp parsing across daylight-saving transitions. Redaction tests cover
34 secret cases, 20 benign readings and nested sensitive fields. The synthetic
report remains within the existing redaction cost limit.
Plugin lint reports no errors or warnings. Repository manifest validation and
git diff --checkpass.Screenshots / Videos
Checklist
idafter the/inplugin.tomlexactly.plugin.toml,README.md,thumbnail.webp, andtranslations/en.json.README.mdfollows theREADME template, documents
every entry id and dependency, and includes exact panel IPC commands and launcher prefixes where applicable.
thumbnail.webpis present and relevant; for a new plugin I created it with the thumbnail generator, and for an update I regenerated it with the generator if the visual identity or user-facing appearance changed.versionfollows semver and is bumped in this PR;plugin_apiis the oldest API level this plugin requires.understand that language well enough to review and maintain it (no unreviewed machine/LLM translations).
catalog.toml; CI generates it.Code review attestation
Plugins run as trusted, unsandboxed Luau in the user's session. Confirm:
licensedeclared inplugin.toml.