feat: show managed quota in footer - #2782
Conversation
🦋 Changeset detectedLatest commit: 88e4759 The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 88e4759b11
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| return this.cachedUsage === undefined ? undefined : { usage: this.cachedUsage }; | ||
| } | ||
|
|
||
| if (this.inFlight?.provider === provider) return this.inFlight.promise; |
There was a problem hiding this comment.
Let forced quota refresh bypass stale in-flight loads
When a /login or same-provider config refresh happens while a background managed-usage request is already in flight, the forced refresh issued by the auth path still returns that old request here. Because syncProvider() only invalidates when the provider id changes, the stale response can repopulate the footer with pre-login quota data (or leave it empty after an old failure) and skip fetching with the new credentials until a later poll/activity refresh. Treat force as a superseding read or invalidate the controller on same-provider auth changes.
Useful? React with 👍 / 👎.
| return this.toolkit.getManagedUsage(providerName, { | ||
| oauthRef: auth.oauthRef, | ||
| baseUrl: auth.baseUrl, | ||
| ...(apiKey === undefined ? {} : { accessToken: apiKey }), |
There was a problem hiding this comment.
Pass the optional accessToken directly
When passing an optional property, the repository rule says to pass undefined directly rather than using conditional spread; this new options object omits accessToken via spread even though the callee option is optional. Please pass accessToken: apiKey directly (and mirror that in the v2 auth service call) so the new managed-usage auth path follows the repo-wide object construction convention.
AGENTS.md reference: AGENTS.md:L51-L53
Useful? React with 👍 / 👎.
Related Issue
Resolves #872
Problem
The interactive footer only shows context-window usage. Managed-plan users must open
/usageto see their 5-hour and weekly quota windows, and the existing managed-usage lookup only reads OAuth storage even when the provider is configured with an API key.What Changed
managedUsageto customstatus_line.commandJSON payloads/usageand/statuspanelsVerification
git diff --checkChecklist