Repository navigation
feat(vault): read Claude quota from insula; adopt common-auth 0.19.1 - #389
Draft
antauth-alfonso[bot] wants to merge 9 commits into
Draft
antauth-alfonso[bot] wants to merge 9 commits into
antauth-alfonso[bot] wants to merge 9 commits into
Conversation
…ttle insula test publication
… ClaustrumConsumer
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
writeSidebarStateAtomic read its test hooks once, when the write began, and reused that snapshot after the rename. A test that installed its listener mid-write, after reading the old file, never heard the rename and waited until its 5 s timeout. That flaked "feed publication failure does not affect response, quota persistence, or sidebar update" about 3 in 40 runs on main and this branch alike. The after-rename hook is now looked up at rename time; production runs without hooks.
The shared-source test catches both mutants at its first assertion, a toBe on the reading time, so its failure message is toBe rather than toEqual.
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.
Vault mode reads Claude quota from insula, the fleet's quota monitor, instead of every plugin polling Anthropic's usage endpoint itself, and adopts
@cortexkit/common-auth@0.19.1(gitHead 271bc3da, integrity matching the signed-off candidate), which makes insula's consumer-free reader public.acquireInsulaQuotaSource(shared per connection file and enrollment token, one refresh a minute), thencurrent('claude', accountId)per vault account, joined by the vault's account_id only. A current reading is published bound to the served credential version and our own usage poll is skipped for that account; anything else (missing, stale, errorClass, over four minutes, or a credential for a different account) falls back to our poll for that account immediately.primary/secondary, model-scoped weeklies (Fable) fromextraRateWindowsby id,usedPercentas is, and every window's reading time is insula'sfetchedAt. A newer window on disk is never overwritten by an older insula one.Mutation rows guard the account join, the poll skip and the release.
Summary by cubic
Vault mode reads Claude quota from insula, the fleet's quota monitor, instead of every plugin polling Anthropic's usage endpoint itself, and adopts
@cortexkit/common-auth@0.19.1, which exposes the consumer-free insula reader. Local mode, or a missing or unreadable enrollment token, never touches insula.extraRateWindows, and the Extra usage pool; a newer stored window is never overwritten by an older insula one.Written for commit 5f1724d. Summary will update on new commits.