Repository navigation
feat(quota): record and chart Qoder credit usage - #40
Merged
Merged
Conversation
A Qoder account is an auth file holding a personal access token
({"type":"qoder","personal_access_token":"..."}). The recorder exchanges
it for a session token at api.qoder.sh/api/v1/jobToken/exchange, the
exchange Qoder CLI makes for QODER_PERSONAL_ACCESS_TOKEN, and caches the
session until shortly before it expires. It then reads
/sash/api/v2/me/usage (the figures Qoder CLI's /usage shows), falling
back to /api/v2/quota/usage, and the plan tier from /api/v2/user/plan.
None of these requests spend credits, and the global endpoints answer in
plain JSON.
Plan credits become a "monthly" window that resets at the plan refresh
time; bought add-on credits become a non-renewing "add_on" window.
Qoder is not routed through the hub, so like Mistral its readings stay
out of routing. Built-in plan weights: Pro 1, Pro+ 3, Ultra 10.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Qoder joins Mistral as a provider the panel shows from the hub's recorded history alone, with its own tab, label, type colors and the ACP registry icon inlined as light and dark assets. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The reset assertion ran after ranging over a map, so it failed whenever the case without a reset time was iterated last. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Qoder spends add-on credits, which never renew, before the plan's monthly credits. One-off balances stay out of pools in general; Qoder's add_on window is charted explicitly so the card does not show an untouched pool while credits drain. The owner-pool dev fixture gains a Qoder Ultra account. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Qoder credit usage did not appear in the quota panel. The hub now reads it.
qoderauth file holds a Qoder personal access token. The recorder exchanges it atapi.qoder.sh/api/v1/jobToken/exchangeand reads/sash/api/v2/me/usage(falling back to the quota and plan endpoints).monthlyplan credits andadd_oncredits. Add-on credits never renew, but Qoder spends them first, so the panel charts them next to the plan credits. Before this, the panel showed only the untouched monthly window.Depends on #38 and #39 (merged into this branch).
Testing:
go test ./internal/quotahistory/(the map-order flake is fixed) andbun run verifypass; live on the hub, which reads plan Ultra and add-on credits.🤖 Generated with Claude Code