Skip to content

fix(models): preserve free-model metadata from discovery - #12763

Merged
diegosouzapw merged 3 commits into
cheaper-inference:release/v3.8.51from
keeltrace:fix/free-mode-provider-resolution-release-20260904
Sep 18, 2026
Merged

diegosouzapw merged 3 commits into
cheaper-inference:release/v3.8.51from
keeltrace:fix/free-mode-provider-resolution-release-20260904

Conversation

@keeltrace

@keeltrace keeltrace commented Sep 5, 2026 •

Copy link
Copy Markdown
Contributor

Problem

Provider discovery can identify a model as free, but synced-model normalization drops that metadata before the provider-model UI and other existing consumers can read it.

Change

Preserve isFree: true on synced discovered models when the discovery payload provides intrinsic free evidence:

  • explicit isFree: true
  • a model id ending in :free
  • exact zero prompt and completion pricing

Blank or non-zero pricing does not mark a model free.

Scope

Metadata preservation only. This PR does not change routing, candidate selection, connection selection, or provider-specific discovery behavior.

Tests

Focused coverage verifies:

  • explicit free flags
  • :free ids
  • exact-zero pricing
  • blank-price rejection
  • paid-model rejection
  • preservation through synced-model normalization

Based directly on release/v3.8.51.

@keeltrace
keeltrace marked this pull request as ready for review September 5, 2026 03:40
@keeltrace
keeltrace marked this pull request as draft September 5, 2026 06:15
@keeltrace keeltrace changed the title fix: resolve free routing from live provider economics fix(models): preserve live free economics in synced discovery Sep 5, 2026
@keeltrace
keeltrace force-pushed the fix/free-mode-provider-resolution-release-20260904 branch 2 times, most recently from 30701f0 to 0861e9a Compare September 5, 2026 16:31
@keeltrace
keeltrace force-pushed the fix/free-mode-provider-resolution-release-20260904 branch from 67bc98a to a7789c2 Compare September 5, 2026 16:46
@keeltrace
keeltrace marked this pull request as ready for review September 5, 2026 16:47
@keeltrace keeltrace changed the title fix(models): preserve live free economics in synced discovery fix(models): preserve free-model metadata from discovery Sep 5, 2026
@diegosouzapw

Copy link
Copy Markdown
Collaborator

Clean, well-scoped fix — tests pass clean (2/2 test blocks, full scenario coverage). One thing
missing before merge: no changelog.d/fixes/ fragment in this PR — could you add one? Also
noting for the record: this overlaps src/lib/providerModels/modelDiscovery.ts with #12730 in a
different, unrelated function — no conflict expected.

Co-authored-by: diegosouzapw <8016841+diegosouzapw@users.noreply.github.com>
@diegosouzapw

Copy link
Copy Markdown
Collaborator

Thanks @keeltrace — merging via the release merge-train. Validated in local merge-train (merge-train-20260918-120911-suite.log) on the devbox @ train tip 8c305709478b7052fb981a75852bbf88fe3a959d with the sibling PRs of this batch: typecheck:core, file-size, complexity, cognitive-complexity, changelog-integrity green; changed-area node:test 310/311 (the single red, hard-lease inventory, reproduces on the pure release tip) + vitest green (fast parity mode — full suite ran today on the tip via the base-red and 3b trains). Merged --admin per merge-gates §4/§7.

@diegosouzapw
diegosouzapw merged commit 95d3b16 into cheaper-inference:release/v3.8.51 Sep 18, 2026
10 of 16 checks passed
muhamadgalihsaputra pushed a commit to niyatna/NiyatnaRoute that referenced this pull request Sep 27, 2026
…erence#12763)

* fix(models): preserve live free economics in synced discovery

* docs(changelog): add fragment for free-model metadata discovery fix

Co-authored-by: diegosouzapw <8016841+diegosouzapw@users.noreply.github.com>

---------

Co-authored-by: diegosouzapw <8016841+diegosouzapw@users.noreply.github.com>
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.

2 participants