Skip to content

Show Mistral API and Vibe budget usage - #8295

Merged
lidge-jun merged 56 commits into
devfrom
codex/quota-mistral-budget
Nov 10, 2026
Merged

lidge-jun merged 56 commits into
devfrom
codex/quota-mistral-budget

Conversation

@lidge-jun

@lidge-jun lidge-jun commented Nov 7, 2026 •

Copy link
Copy Markdown
Owner

Summary

Verification

All local checks used temporary isolated homes under env -i. The following focused checks were rerun on head 0d8340f3ff9dee762476b17f346617d2a7a822f7:

  • bun test tests/providers/mistral-budget-quota.test.ts tests/usage/mistral-budget-reset-identity.test.ts tests/usage/quota-pool.test.ts tests/cli/cli-account-key-quota.test.ts: 105 passed, 0 failed. New feature, passive credential ownership and terminal-control regressions were demonstrated failing before their fixes.
  • bun run typecheck, bun run privacy:scan and bun run structure:check: exit 0. The docs site build completed 665 pages after installing its locked dependencies.
  • On the combined tree with dev e9fdc004, the same focused tests passed 105/0, GUI budget tests passed 10/0, and typecheck, privacy and structure passed. The combined guide size initially exceeded the ratchet; after reflow, bun test tests/ci-workflows/file-size-ratchet.test.ts passed 9/0 on the new combined tree. Layout and Lab guards passed on the preceding combined tree; the final change was documentation-only.
  • Synthetic-data browser inspection showed the measured amount and plan together with an unknown Vibe window. Earlier dashboard captures: Before After
  • Fresh independent functional and separate security reviews found no actionable issues on exact head 0d8340f3; both used hyds/deepseek-v4.1-flash-1m.
  • bun run test:changed on preceding code head 80041d13: 42,444 passed, 108 skipped, one package-tree integrity test timed out. That test passed separately on the same head; the full changed suite did not pass. Full GUI bun test on candidate 95dcdac7 and dev base 33726958 had the same 43 failures, no candidate-only failures; nine affected files passed when run separately. These failures remain recorded, not described as passing.
  • NOT RUN: full bun run test, native Windows execution or live Mistral credential verification. No per-PR cross-platform workflow was dispatched.

Checklist

  • Scope stays focused and avoids unrelated cleanup.
  • Docs or release notes were updated when needed.
  • Security-sensitive changes were reviewed for secrets, auth, and unsafe defaults.

@coderabbitai

coderabbitai Bot commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

Caution

Review failed

The pull request is closed.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@github-actions

github-actions Bot commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

✅ Deterministic PR hygiene checks passed.

@lidge-jun lidge-jun mentioned this pull request Nov 7, 2026
3 tasks done
@github-actions github-actions Bot added the bug Something isn't working label Nov 7, 2026
Comment thread src/providers/quota/muse-owner.ts Outdated
export function museQuotaConfigIdentity(config: OcxConfig, provider: string): string | undefined {
const current = config.providers[provider];
if (!current || current.disabled || current.authMode !== "oauth") return undefined;
return createHash("sha256").update(JSON.stringify([current.adapter, current.baseUrl, current.authMode])).digest("hex");
# Conflicts:
#	src/providers/quota.ts
#	src/providers/quota/vendor-probes-oauth.ts
#	src/quota-pool/assemble.ts
#	tests/usage/quota-pool.test.ts
Preserve current dev behavior for existing providers and retain the Mistral
budget feature, scoped cache ownership, and regression coverage. Remove the
unrelated PR-only ownership changes authorized for separation.

Mistral candidate: 95dcdac74148bf19c9ce41cda582f7ac21c2be32
Keep passive reads free of provider probes and keychain access while withholding
reports whose credential or destination can no longer be verified.
@lidge-jun lidge-jun changed the title Show Mistral API and Vibe budget quota Show Mistral API and Vibe budget usage Nov 10, 2026
@lidge-jun

Copy link
Copy Markdown
Owner Author

Maintainer judgment — 0d8340f3ff9dee762476b17f346617d2a7a822f7

  • Value: Implements [Feature]: Show Mistral API and Vibe budget usage from /v1/billing/budget #8290's missing Mistral API/Vibe budget and plan visibility; no duplicate Mistral budget PR was found in the title search.
  • UX: The intended dashboard/CLI budget display is documented. Unknown budgets stay unknown; the change does not grant them routing authority. Synthetic browser inspection confirmed the amount, plan and unknown state.
  • Existing users: Non-Mistral reset identity and Muse persistence retain the dev behavior. Failing-first credential, passive-read and terminal-label regressions pass; focused isolated-home tests passed 105/0. The full GUI run's 43 failures matched the dev-base failure set exactly; changed-tests had one package-tree timeout on the previous code head, which passed in isolation and is not claimed as a passing suite.
  • Windows: The change uses existing Bun/TypeScript fetch, crypto and React paths; no native Windows run was performed. The dev batch at 5cb7d65915 passed Windows shards, but is not evidence for this PR head.

Fresh independent functional and separate security reviews found no actionable findings on this exact head (hyds/deepseek-v4.1-flash-1m). Combined-tree focused checks against dev e9fdc004 passed; the final documentation-only reflow also passed the union size ratchet.

@lidge-jun
lidge-jun marked this pull request as ready for review November 10, 2026 16:31
@lidge-jun
lidge-jun requested a review from Ingwannu as a code owner November 10, 2026 16:31
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-10T16:34:00.975105Z 0d8340f Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@lidge-jun
lidge-jun merged commit 97bfb91 into dev Nov 10, 2026
35 of 38 checks passed
@lidge-jun
lidge-jun deleted the codex/quota-mistral-budget branch November 10, 2026 16:31
lidge-jun added a commit that referenced this pull request Nov 10, 2026
)

* fix(quota): keep the Mistral budget helper off the core load path

#8295 imported mistralUnknownBudgetWindows statically from src/quota/window-mapping.ts into src/providers/quota.ts, which the core request path loads, breaking tests/usage/quota-reset-core-boundary.test.ts. Move the pure helper beside its caller.

* test(quota): pin Mistral budget window selection at its new home
lidge-jun added a commit that referenced this pull request Nov 12, 2026
…droom-into-dev

Integrates #8297 passive key-limit observation onto dev while keeping dev's
#8295 Mistral budget, the exact credential optional binding, Claude held
reports, the Vertex final-send guard and Muse passive observation.

The owner-rejected feature-only Muse ownership ledger, the Antigravity quota
owner, and the reset-identity and key-quota-scope hardening are not restored;
those files are removed with the PR's own additions.

Security-review fixes carried in this merge:
- Passive cache identity and invalidation are scoped to the config home that
  observed the send, so the same provider and key in another home neither
  reads, replaces, nor retires this home's rows.
- A redirect is never a reading, and a parsed response with no count,
  remaining value, or reset no longer advances the sequence fence, so an
  older real response can still settle after a newer headerless 302.

Ratchets: providerRoutingQuota moves to provider-routing-quota.ts so
provider-routes.ts returns under the 2000-line new-file bound, and the
providers guide keeps dev's budget prose plus a compact passive-observation
note within the same bound. quota.ts stays at its 558-line cap.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working ci:full Run the four full Ubuntu test shards on this pull request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: Show Mistral API and Vibe budget usage from /v1/billing/budget

2 participants