Skip to content

feat: improve usage tracking, reporting and remove debug logs#71

Open
RaphaelManke wants to merge 1 commit intotickernelz:masterfrom
RaphaelManke:feat/usage-tracking-improvements
Open

feat: improve usage tracking, reporting and remove debug logs#71
RaphaelManke wants to merge 1 commit intotickernelz:masterfrom
RaphaelManke:feat/usage-tracking-improvements

Conversation

@RaphaelManke
Copy link

@RaphaelManke RaphaelManke commented Mar 18, 2026

Changes

Usage sync throttle

  • Add 60s per-account cooldown to UsageTracker to avoid hammering getUsageLimits on every request
  • Previously every successful request triggered a usage sync call — with high request volume this could itself trigger rate limits

Usage sync error logging

  • Log usage sync failures after all retries instead of silently swallowing them
  • Makes it visible in ~/.config/opencode/kiro-logs/plugin.log when usage sync is consistently failing

Startup usage summary

  • Show a toast on startup with current usage per account: Kiro usage (user@example.com): 37/1000 (3.7%)
  • Show as warning variant when at 90%+ of quota, info otherwise
  • Also written to the log file on every startup

Quota warning toast

  • Show a warning toast when a selected account reaches 90% of its quota
  • Uses existing shouldShowUsageToast() debounce to avoid spam

- Add 60s per-account cooldown to usage sync to avoid hammering getUsageLimits
  on every request
- Log usage sync failures after all retries instead of silently swallowing them
- Show startup toast with current usage per account (e.g. 'Kiro usage: 37/1000 (3.7%)')
- Show warning toast when account reaches 90% of quota
- Wire up previously dead formatUsageMessage to show quota warnings
- Remove all console.log('[DEBUG]') and debugger statements from
  idc-auth-method.ts and usage.ts that were polluting the UI output
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