Repository navigation
fix(qoder): show the Teams organization balance - #5140
gushan1wood wants to merge 33 commits into
Conversation
When the merged member quota is empty, read the captured Teams organization resource package from the supplemental usage response and expose it as the secondary Balance window. Keep the existing Credits and Balance labels, use the plan refresh for the primary reset, and keep the member summary as the fallback. Mark zero-capacity plans exhausted, let a positive remaining balance win over stale used/capacity counters, and localize the balance detail. A nonempty member summary keeps its existing single-request behavior. Related to steipete#5103
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex review: needs maintainer review before merge. What this changesThis PR adds a same-session supplemental lookup to show Qoder Teams organization credits when the member quota is empty. Example: A Teams account has zero member credits and an organization package with 1,200 used of 5,000 credits.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Partial Merge readiness✅ Ready for maintainer review Keep open: this PR addresses a maintainer-confirmed Teams bug within the requested narrower scope, with no concrete blocking defect found. Priority: P2 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherThe bundled Qoder plugin converts authenticated usage responses into usage snapshots, and the provider descriptor controls how the CLI, menu, and menu bar present those windows. flowchart TD
A[Qoder session] --> B[Member usage request]
B --> C[Qoder plugin]
C --> D[Supplemental Teams request]
D --> E[Usage snapshot]
C --> E
E --> F[Provider presentation policy]
F --> G[CLI and menu]
Technical reviewBest possible solution: Land the bounded Teams repair while retaining the broader coverage request in the linked issue. Do we have a high-confidence way to reproduce the issue? The captured type-preserving Teams fixtures and current-main source establish the missing organization window; this read-only review ran no tests, builds, or account probes. Is this the best way to solve the issue? The optional same-origin lookup and existing descriptor policies fit the maintainer-requested repair without adopting the rejected personal-add-on redesign. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 8c0541ec4989. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
Preflight sourceSource unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified. Review metrics
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. LabelsLabel changes:
Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed November 21, 2026, 12:05 AM ET / 05:05 UTC. |
Sort switcher buttons without changing active highlighting or stacked-card order, with a regression against the rendered buttons. Co-authored-by: Salem Sfaxi <42436939+sfxsalem@users.noreply.github.com>
Share Claude account presentation with Overview, preserve the ambient Fleet fallback, and refresh hosted charts when account ownership changes. Co-authored-by: Craig Davison <5341072+davisonio@users.noreply.github.com>
Keep one combined This Mac cost section across segmented, stacked, and compact layouts, without copying it into account cards or moving it below Plan Usage. Co-authored-by: michael0903 <83710802+michael0903@users.noreply.github.com>
Limit displayed grant details to the first 24 rows so larger responses retain their reported balance and spend. Co-authored-by: Yuxin Qiao <104957188+Yuxin-Qiao@users.noreply.github.com>
Decode saved Codex file details once, preserve completed-scan coverage, and keep provider locks in application support. Add localized `dashboard --no-cost` and honor explicit `/usage` all-account requests while preserving default collection and authentication. Co-authored-by: Daniel JB Clark <djbclark@gmail.com>
Use the official MiMo Token Plan API through the bundled plugin and expose Grok's existing prepaid balance in the menu bar. Keep quota, cash balance, and account sources separate.
Expose the already parsed available balance in provider cost snapshots without adding requests or authentication sources. Co-authored-by: Fatih C. Akyon <34196005+fcakyon@users.noreply.github.com>
Read the identified operator's fixed-origin key endpoint, preserve reservation-aware and zero-dollar limits, and register the provider across the app, CLI, catalogs, and docs. Co-authored-by: Joseph Perla <claude@jperla.com>
Read verified Standard and Select billing-period allowances even when the legacy status is not_applicable, keeping their exact credit counts and dates separate from optional workspace credits. Localize the new display and preserve bounded, cancellable requests. Co-authored-by: Alex Palei <apalei@gmail.com>
Accept enterprise-paid workspace output without fabricating a balance or quota, and preserve any independently reported Free or subscription usage. Co-authored-by: Greg Meyer <greg.meyer@ofbasis.com>
Price native Ultrafast usage at published, date-aware rates and preserve its tier through parsing, pricing, recovery and cached history.
Project retained Codex cost reports to the requested history period without discarding the wider cached history. Co-authored-by: Yuxin Qiao <104957188+Yuxin-Qiao@users.noreply.github.com>
Read Tokscale JSON caches for Cursor local spend fallback while preserving snapshot deduplication and Manual credential boundaries. Co-authored-by: Vincent Peng <mail@vincentpeng.me>
Give the cost history model stack full width so its scrollbar aligns with the menu edge. Co-authored-by: Soohan Park <725psh@gmail.com>
Show point labels, values and units when hovering plugin detail-chart bars, reusing the shared bar selection. Co-authored-by: tangwz <tangwz.com@gmail.com>
Restore the README introduction to the complete provider list and keep the generator accurate. Co-authored-by: Craig Davison <5341072+davisonio@users.noreply.github.com>
Point provider-status instructions to General, Refreshing. Co-authored-by: Nuno Hespanhol <nuno.hespanhol@gmail.com>
Add a pinned compact state to the existing Linux Quick View window, with expand and pin controls and accessibility text. Co-authored-by: WizLiang <1749460483@qq.com>
Update Commander 0.3.1, SweetCookieKit 0.6.0, swift-crypto 5.1.2, swift-log 1.17.2 and swift-asn1 1.7.4, setup-node 7.1.0 and the release Sparkle signer 2.10.1. Keep browser imports gated, add Chrome Dev to the shared browser order, and keep the app and widget pins synchronized. Map Chrome Dev for Cursor interactive login.
Keep successful balance-only results as current-scope unavailable publications, so DeepSeek and xAI no longer trigger a second provider fetch when Usage & Spend fills missing data, and repeated unavailable results no longer advance the dashboard recovery counter. Missing publications, changed credentials or account scope, failed refreshes, and confirmed-empty spend keep their existing behavior. Refs steipete#5057.
Pass retry and deadline callbacks explicitly instead of binding closures into TaskLocal values, which crashed optimized Linux builds in plugin HTTP requests. Add an optimized Linux usage/serve smoke regression covering Hugging Face, OpenRouter, and z.ai. Fixes steipete#5154, steipete#5190, steipete#5210. Co-authored-by: Remy Huang <me@remya.top>
Constrain the pinned capsule geometry and avoid X11 edge expansion while dragging, restoring expanded resize limits afterwards. Cover the size contract in QML tests. Co-authored-by: WizLiang <1749460483@qq.com>
Re-publish the compact X11 shape after geometry and desktop updates without moving the window. Adopts steipete#5226 with a QML recovery regression. Co-authored-by: WizLiang <1749460483@qq.com>
Render one centered tray track when a provider reports one quota window, while keeping a real second window at 0% visible. Share the existing renderer with a pixel regression. Co-authored-by: WizLiang <1749460483@qq.com>
Let manual cookies and the documented PERPLEXITY_COOKIE / PERPLEXITY_SESSION_TOKEN sessions pass the Linux CLI browser-support gate while keeping Off authoritative. Add Linux gate coverage and CLI documentation. Co-authored-by: Fguarien <503361+Fguarien@users.noreply.github.com>
Merge current main with the captured-shape Teams repair, keep credit localization in the provider, and cover timeout and cancellation fallback. Preserve the existing zero-capacity member response unless a Teams balance is accepted. Co-authored-by: gushan1wood <8131302+gushan1wood@users.noreply.github.com>
Summary
A focused, captured-shape replacement for the closed #5107.
/sash/api/v2/me/usagewith the existing session.orgResourcePackagefor the captured TeamsuserType, and expose it as the secondaryBalancewindow.Credits/Balancelabels. Do not add personal add-on, extra-window, dedicated-package, or new label handling.refreshAt/expiresAtonly for the primary plan reset; do not turn it into a subscription renewal.isQuotaExceeded.cap - remainingso the detail and percentage agree; omit the numeric detail whenisQuotaExceededis the only exhaustion evidence.creditssuffix using the existing catalog string.Related to #5103. The issue stays open for the remaining broader coverage.
Tests
swift test --filter 'Qoder'— 32 app/settings/cutover tests in 9 suites plus 9 plugin tests in 2 suites passed.make checkwith the documented Python 3.14 — exit 0; SwiftLint 0 violations in 3247 files.oxfmt,oxlint,swiftformat --lint,node Scripts/check-app-locales.mjs, andgit diff --checkpassed.Live proof (redacted)
Captured with the focused branch build, using a manual
qoder.comcookie./api/v2/me/usages/big_model_credits): HTTP 200;total_quotaused/limit/remaining are all0; the member reset is present./sash/api/v2/me/usage): HTTP 200;displayMode: "qoder",userType: "teams",userQuota.total: 0;orgResourcePackage.available: truewith non-zero cap/used/remaining; noaddOnQuota;refreshAtpresent;isQuotaExceeded: false.CodexBar.app/Contents/Helpers/CodexBarCLI usage --provider qoder, manual source):source: "manual / qoder.com"rateWindowLabels: primaryCredits, secondaryBalanceusedPercent: 100, detail present, plan reset presentsubscriptionRenewsAt: absentBase-fail/head-pass:
0 / 0and no organization window.Balancewindow; the percentage and detail agree, and Automatic selects the positive balance.QoderTeamsOrgBalanceTests(9 tests, both engines),QoderTeamsOrgBalanceBehaviorTests, and the existing Qoder suites.Verification
Exact head:
ac6032d6050c0755f5de0ad5e1002e203218186fCompatibility
docs(changelog)entry will follow after approval, referencing this PR.