Skip to content

fix(models): preserve live free economics in synced discovery - #12763

Draft
keeltrace wants to merge 7 commits into
diegosouzapw:release/v3.8.51from
keeltrace:fix/free-mode-provider-resolution-release-20260904
Draft

fix(models): preserve live free economics in synced discovery#12763
keeltrace wants to merge 7 commits into
diegosouzapw:release/v3.8.51from
keeltrace:fix/free-mode-provider-resolution-release-20260904

Conversation

@keeltrace

@keeltrace keeltrace commented Sep 5, 2026

Copy link
Copy Markdown

Summary

Preserve provider-declared free-model economics through model discovery normalization and the per-connection synced-model cache.

This PR is intentionally metadata-only. It records the fact that a provider discovery payload identified a model as free; it does not change routing, candidate selection, strict-zero-cost enforcement, tier precedence, or provider-specific discovery behavior.

What changes

  • add optional isFree metadata to SyncedAvailableModel
  • preserve isFree: true through synced-model normalization/serialization
  • derive the persisted flag only from evidence present in the current discovery payload:
    • explicit isFree: true
    • a model id ending in :free
    • exact zero prompt and completion pricing
  • keep those three live-evidence checks local to discovery so static catalog/provider membership cannot masquerade as connection-scoped evidence and the API-route typecheck does not pull in the full provider registry
  • add focused regression coverage for discovery normalization and synced-model serialization

Non-goals

No changes in this PR to:

  • auto/*:free
  • hidePaidModels
  • STRICT_ZERO_COST
  • routing allowlists or connection selection
  • tier overrides/precedence
  • discovery freshness/quota state
  • Nous or other provider-specific discovery

Those consumers, if still needed, can be proposed separately after this metadata contract lands.

Verification

The branch remains narrowed against release/v3.8.51 to exactly three changed files. CI on the current head is the execution proof; this PR remains draft until those checks complete.

@keeltrace
keeltrace marked this pull request as ready for review September 5, 2026 03:40
@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
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