Skip to content

feat(core): enrich model catalog metadata - #349

Merged
Astro-Han merged 5 commits into
mainfrom
codex/model-metadata-limits
Jun 28, 2026
Merged

feat(core): enrich model catalog metadata#349
Astro-Han merged 5 commits into
mainfrom
codex/model-metadata-limits

Conversation

@Astro-Han

@Astro-HanAstro-Han commented Jun 28, 2026

Copy link
Copy Markdown
Contributor

Summary

Enrich core model catalog metadata with static limits and lightweight capabilities for curated models, then use provider/access-path-specific facts only when provider discovery did not return them.

Why

Future context-budget and compaction decisions need per-model context window and max output token facts. Today the catalog can carry those fields, but many provider model-list responses do not include them, leaving known models with undefined limits.

Scope

Changed:

  • Added optional contextWindow, maxOutputTokens, and capability metadata to the curated model metadata table.
  • Filled those facts for the existing curated Anthropic API, OpenAI API, OpenAI OAuth, Google/Gemini, DeepSeek, and Z.AI catalog entries from provider-specific sources, using models.dev/api.json where available.
  • Kept Claude subscription metadata display-only, so it does not inherit Anthropic API limits or capabilities without subscription-specific evidence.
  • Kept curated catalog fallback model lists explicit for no-live-model cases, so fallback choices can show current models without changing provider readiness/default-provider definitions.
  • Updated catalog entry construction so provider-returned limits win, provider capability fields win per field, static metadata fills only missing fields, and availability is derived from merged capabilities.
  • Presented the ChatGPT/Codex account path as OpenAI OAuth in provider defaults, settings provider cards, and chat model group headings.
  • Added regression coverage for static fallback, curated catalog fallback, provider precedence, partial capability merge, availability from merged capabilities, OpenAI API vs OpenAI OAuth context differences, Anthropic API vs Claude subscription metadata differences, provider-specific Anthropic API limits, provider display labels, missing default entries, and unknown ids.

Not included:

  • No provider key, IPC channel, file name, or environment variable rename for the existing codex-subscription internal identifier.
  • No provider key, IPC channel, file name, or environment variable rename for the existing claude-subscription internal identifier.
  • No readiness or send-gate changes.
  • No runtime ContextBudgetPolicy or automatic compaction behavior changes.
  • No ModelCatalogEntry shape change or per-field provenance object.

Verification

  • npm run -w @maka/core test
  • npm run -w @maka/ui test
  • npm run -w @maka/desktop test -- --test-name-pattern "visible copy|OpenAI OAuth account path"
  • npm run typecheck
  • git diff --check

User-facing impact

Known model catalog entries now carry richer metadata that future budget/compaction work can consume. The ChatGPT/Codex OAuth account path is now labeled OpenAI OAuth in visible provider/model picker surfaces. When live model discovery is unavailable, catalog entries can use curated fallback choices so current known models still appear in the picker.

Reviewer notes

Review fixes included: OpenAI OAuth no longer reuses OpenAI API GPT-5.5 limits, Claude subscription no longer reuses Anthropic API limits or capabilities, partial provider capabilities now merge per field while preserving explicit false, availability uses those merged capabilities, Anthropic API Sonnet 4.6 uses the provider-specific 128K max output limit, and curated catalog fallbacks are named and tested as an intentional no-live-model picker behavior. Internal subscription identifiers are intentionally left unchanged in this PR to avoid unrelated migrations.

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

@Astro-Han