cortexkit-provider-usage 0.2.0: add optional apiProvider field#6
Merged
Conversation
Adds ProviderUsage.api_provider (wire: apiProvider, camelCase, omitted when absent) carrying the canonical models.dev provider slug alongside the CodexBar provider name — e.g. "openai" for provider=="codex", "anthropic" for "claude", "google" for "gemini", "xai" for "grok". Three consumers (ALF's router, the ck CLI, astrocyte's capacity axis) each hand-roll the same CodexBar→canonical translation today; this field lets them key on one canonical name instead. Producers populate it when the canonical name is known and leave it absent for providers with no models.dev counterpart (consumers fall back to provider). Additive + skip-if-none: unpopulated entries serialize byte-identically to 0.1.
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.
Adds
ProviderUsage.api_provider(wireapiProvider, camelCase, omitted when absent) — the canonical models.dev provider slug alongside the CodexBarprovidername.Why: three consumers (ALF's router reads, the ck CLI renderer, astrocyte's capacity axis) each hand-roll the same CodexBar-name→canonical translation (claude→anthropic, codex→openai, gemini→google, grok→xai). This field gives them one canonical name to key on, killing the per-consumer maps and their drift risk. astrocyte's capacity↔spend join specifically needs the canonical name to match broca's model-catalog-keyed spend facts.
Contract: populated when the producer knows the canonical name; absent for providers with no models.dev counterpart (antigravity, cursor, factory, etc.), where consumers fall back to
provider.Compatibility: additive + skip-if-none — entries without it serialize byte-identically to 0.1.0. Version bumped 0.1.0→0.2.0 (struct gains a field). The quota module populates it centrally in its read path; ALF/ck consume it when present. Publish is tag-driven per release.yml (cortexkit-provider-usage-v0.2.0) once merged.
Need help on this PR? Tag
/codesmithwith what you need. Autofix is disabled.Summary by cubic
Add optional
apiProvidertoProviderUsageto expose the canonical models.dev provider slug alongsideprovider.apiProvidertoProviderUsage(serialized as camelCase, omitted when not set).providerotherwise.cortexkit-provider-usageto0.2.0; change is additive and backward compatible.Written for commit 2f1d4cd. Summary will update on new commits.