Skip to content

feat: generic plugin-driven usage & quota modal - #288

Open
JamesDAdams wants to merge 2 commits into
co-l:developfrom
JamesDAdams:feat/usage-quota
Open

feat: generic plugin-driven usage & quota modal#288
JamesDAdams wants to merge 2 commits into
co-l:developfrom
JamesDAdams:feat/usage-quota

Conversation

@JamesDAdams

@JamesDAdams JamesDAdams commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

Summary

Added generic plugin-driven usage & quota tracking to OpenFox:

  • Introduced generic QuotaMetric, QuotaSource, and QuotaReport types supporting windowed limits and token balance metrics.
  • Extended the provider plugin contract with QuotaProvider and registerQuotaProvider.
  • Added the /api/quota server endpoint to aggregate quota metrics across all loaded plugins.
  • Built a QuotaModal component accessible via a new header action button, with visual indicators for metrics approaching or exceeding limits.

AI-Enhanced Development

Tell what models helped shape this PR:

  • AI Models: Gemini 3.6 Flash

Cache Impact

Does this PR affect anything cached — system prompts, tool definitions, skills, or other context?

  • No

@JamesDAdams

Copy link
Copy Markdown
Contributor Author
image

Quota push from plugins

@JamesDAdams

JamesDAdams commented Aug 29, 2026

Copy link
Copy Markdown
Contributor Author

@co-l To not overload the code of Openfox the usage and quota is designed to be fill by plugins

- Add generic QuotaMetric/QuotaSource/QuotaReport types (windowed + token-balance)
- Extend plugin contract with QuotaProvider + registerQuotaProvider
- Aggregate all registered providers via GET /api/quota (resilient to failures)
- Add useQuotaStore (zustand) and QuotaModal (generic, no per-plugin code)
- Add QuotaIcon + header button left of Settings with warning dot (desktop + mobile)
- Shared isQuotaMetricOverLimit helper; auto-refresh (interval + focus) + manual refresh
- Add unit/component tests for aggregation, modal shapes, and header button
@JamesDAdams

Copy link
Copy Markdown
Contributor Author

@co-l I make the change for i18n translate

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant