Skip to content
Source
Sign inSign up
pingdotgg/t3code

feat(models): discover Claude models from remote manifest #9084

Mergedjuliusmarmingemerged 4 commits intomain fromrefs/pull/9084/headmerged by juliusmarminge View on GitHub

juliusmarmingecommented

What Changed

  • Added a manifest-backed Claude model catalog with runtime version compatibility checks.
  • Moved Claude model capabilities, aliases, context windows, effort mappings, and API model IDs into the model manifest.
  • Updated the Claude driver, adapter, text generation, contracts, web model picker, and model selection logic to use the catalog.
  • Added focused catalog resolver tests and documented the manifest test policy.

Why

Claude model metadata was hard-coded across provider and client code, requiring code changes whenever models or compatibility rules changed. This centralizes the metadata in the remote model manifest while keeping adapter behavior declarative and preserving a bundled fallback when the manifest cannot be used.

UI Changes

No layout changes. The model picker now reflects Claude models and capabilities discovered from the manifest.

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • I included before/after screenshots for any UI changes
  • I included a video for animation/interaction changes

Note

Medium Risk Touches core Claude dispatch (model IDs, effort, context window) and manifest fetch validation; a bad or empty catalog fallback could hide models or mis-route CLI calls until a valid manifest is loaded.

Overview Moves Claude built-in model metadata out of server code into model-manifest.json, resolved at runtime through a new ClaudeModelCatalog layer (capabilities, aliases, Claude Code version gates, effort/context-window mappings, and API model IDs with suffixes).

The manifest schema now supports provider catalogs (profiles, models, optional adapter payloads) with validation and last-good remote cache when later fetches are invalid. Claude provider checks and the adapter/text-generation paths inject the catalog from the current manifest (bundled fallback) instead of the deleted static catalog in ClaudeProvider.ts. Custom models that collide with built-in aliases stay opaque via scopeClaudeModelCatalog.

Client/contracts: ServerProviderModel gains aliases and badge; the model picker shows NEW from badge rather than a hard-coded slug list. Claude slug aliases are removed from MODEL_SLUG_ALIASES_BY_PROVIDER in favor of manifest-driven resolution in resolveSelectableModel.

Tests shift to synthetic catalog fixtures so manifest-only edits do not require test churn; per-model version tests in the registry are dropped.

Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 38962d1c453c913f5b6a0b30eebf1f0816edcce3. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).

Note

Replace hardcoded Claude model definitions with remote manifest catalog

  • Introduces ClaudeModelCatalog (ClaudeModelCatalog.ts) that resolves models, capabilities, effort, context windows, and API model IDs from a provider-neutral manifest, with fallback to a bundled catalog
  • Removes inline model definitions, version guards, and option-resolution helpers from ClaudeProvider.ts; provider init, status checks, adapter, and text generation now consult the injected catalog
  • Expands ModelManifest.ts with provider catalog schemas, referential integrity validation, and resolveProviderCatalog to project normalized models from the manifest
  • Model picker badge ("new") is now server-driven via model.badge instead of client-side slug matching; resolveSelectableModel gains alias resolution support
  • Risk: MODEL_SLUG_ALIASES_BY_PROVIDER for CLAUDE_DRIVER_KIND is now empty — any code or config relying on provider-level alias normalization for Claude slugs will no longer expand them; alias resolution now depends on per-model aliases arrays in the manifest or catalog
Macroscope summarized 38962d1.
    1. github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:trusted

    2. github-actions[bot](GitHub profile, opens in a new tab)commented

      Thread transfer impact

      ✅ Thread transfer remains within every enforced ceiling.

      ProviderMetricMain baselineThis PRImpactPR ceiling
      CodexTotal thread wire13.2 KiB13.4 KiB+212 B (+1.6%)15.1 KiB✅
      CodexThread snapshot wire6.9 KiB6.9 KiB−4 B (−0.1%)7.3 KiB✅
      CodexLive turn WebSocket wire6.3 KiB6.5 KiB+216 B (+3.3%)7.8 KiB✅
      CodexLive turn WebSocket decoded55.5 KiB57.0 KiB+1.5 KiB (+2.7%)66.4 KiB✅
      CodexLive turn messages810+2 (+25.0%)21✅
      ClaudeTotal thread wire13.2 KiB13.2 KiB−8 B (−0.1%)15.1 KiB✅
      ClaudeThread snapshot wire6.9 KiB6.9 KiB−3 B (−0.0%)7.3 KiB✅
      ClaudeLive turn WebSocket wire6.3 KiB6.3 KiB−5 B (−0.1%)7.8 KiB✅
      ClaudeLive turn WebSocket decoded56.3 KiB56.3 KiB0 B (0.0%)66.4 KiB✅
      ClaudeLive turn messages880 (0.0%)21✅

      Baseline: c17d02c · PR result: 38962d1 · Source CI: success

      Scenario and decoded snapshot size

      10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.

      • Codex decoded thread snapshot: 109.4 KiB
      • Claude decoded thread snapshot: 110.1 KiB

      Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed.

    3. Cursor Bugbot has reviewed your changes using high effort and found 2 potential issues.

      Fix All in Cursor Bugbot Autofix is [ON](https://www.cursor.com/dashboard/bugbot), but a cloud agent failed to start. Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit cc6680b4099a0a88f4f54935373bbc1dc12771cc. Configure [here](https://www.cursor.com/dashboard/bugbot).
    4. macroscopeapp[bot](GitHub profile, opens in a new tab)commented

      Approvability

      Verdict: Not approved

      Macroscope's review found this PR not approvable — This PR introduces a remote-driven Claude model catalog that affects provider discovery, model selection, compatibility filtering, CLI/SDK dispatch, and UI metadata across server, shared, contracts, and web layers. It also introduces manifest-controlled default-model metadata, so the scope and product-default impact require human review.

      You can add or adjust custom eligibility rules. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).
    5. waiting for this to get merge so don't have to use custom model name for fable 5.1 and effort using command 🤩

    6. juliusmarminge merged this0354283

    7. juliusmarminge closed this

Sign in to join this conversation.