Skip to content

feat: per-provider default model - #7

Merged
dorukozgen merged 3 commits into
mainfrom
feat/provider-default-model
Jun 22, 2026
Merged

dorukozgen merged 3 commits into
mainfrom
feat/provider-default-model

Conversation

@dorukozgen

Copy link
Copy Markdown
Contributor

What

Adds a first-class default model per provider to the catalog. Each provider declares exactly one model with [fleetify].default = true; the build enforces "at most one default per provider"; the flag flows into dist/.

Why

The Fleetify app needs an authoritative per-provider default so it can self-heal a session's / Fleet's selected model when the chosen model is removed (e.g. Opus 4.8 → Opus 4.9). Previously the catalog had no default concept (ordering was alphabetical), so the app fell back to "first model".

Changes

  • Schema (schema/model.schema.json): new optional fleetify.default boolean (additionalProperties:false, so it had to be declared).
  • Types/emit (scripts/lib/types.ts, scripts/lib/defaults.ts): carry default into the PickerModel dist projection (absent ⇒ false).
  • Pipeline invariant (scripts/lib/pipeline.ts): error if a provider has >1 default model (alongside the existing duplicate-id checks).
  • Authoring: one default = true per provider across all 18 providers (mirror providers — claude/kimi/openrouter — flag the mirror file). claude-code → claude-opus-4-8.
  • dist/ regenerated and committed.

Tests / gates

  • New tests: tests/defaults.test.ts (flag flows through; defaults false), tests/pipeline.test.ts (rejects >1 default).
  • bun run validate ✓ (18 providers, 132 models), bun run build ✓, bun test ✓ (31/31).
  • Verified exactly one default per provider in dist/models.json.

Merge order

Merge this before the app PR (fleetifydev/fleetify feat/provider-default-model) — the app consumes the published catalog (jsDelivr @main / serving API), so the field must ship here first.

Co-Authored-By: Claude Opus 4.8 (1M context) noreply@anthropic.com

🤖 Generated with Claude Code

dorukozgen and others added 3 commits June 22, 2026 19:08
A provider may declare at most one model with fleetify.default = true.
Zero defaults stays valid (the app falls back to the first model); two
or more now aggregate into the existing Validation failed error via the
errors[] path, alongside the duplicate-id checks. The per-file JSON Schema
cannot express this one-true-across-N-sibling-files invariant, so it lives
as a cross-entry check in the pipeline.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@dorukozgen
dorukozgen marked this pull request as ready for review June 22, 2026 18:19
@dorukozgen
dorukozgen merged commit a0f057e into main Jun 22, 2026
2 checks passed
Sign up for free to 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