Skip to content

fix(sync): strip discount suffix from Kilo model IDs when resolving canonical base model - #4960

Open
levdad wants to merge 2 commits into
anomalyco:devfrom
levdad:kilo-discount-models
Open

fix(sync): strip discount suffix from Kilo model IDs when resolving canonical base model#4960
levdad wants to merge 2 commits into
anomalyco:devfrom
levdad:kilo-discount-models

Conversation

@levdad

@levdad levdad commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

When the Kilo provider sync returns model IDs with a suffix, the canonical base model resolution fails because the suffix is not part of the canonical model identity. This strips before calling resolveCanonicalBaseModel.

Change

  • In packages/core/src/sync/providers/kilo.ts, strip :discounted from model.id before resolving the canonical base model.

Validation

  • bun validate should pass.

@github-actions

Copy link
Copy Markdown
Contributor

Action items

  • [high] [violation] packages/core/src/sync/providers/kilo.ts:189 - Check: Provider-specific display names for priced route suffixes must be preserved when factoring onto base_model (same pattern as :free). Why: Stripping :discounted only for resolveCanonicalBaseModel now resolves deepseek/*:discounted to a lab base, but name is still gated on baseModel !== undefined || model.id.endsWith(":free"). On the next Kilo sync, factored discounted models will drop host-specific names (e.g. DeepSeek: DeepSeek V4 Flash 0731 (lowest price)) and inherit the lab name (DeepSeek V4 Flash). Pre-fix, failed canonical resolution kept the full inline name. Action: Preserve name when model.id.endsWith(":discounted") as well (mirror :free), or share one suffix check for both route variants.

@github-actions github-actions Bot added the reviewer: ready Automated review found no actionable items label Aug 18, 2026
Update the logic for determining if a model name should be inherited
from the base model to include the `:free` suffix. This ensures that
both `:discounted` and `:free` variants are correctly identified as
route variants during the model building process.
@github-actions github-actions Bot removed the reviewer: ready Automated review found no actionable items label Aug 19, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Action items

  • [medium] [possible mistake] packages/core/src/sync/providers/kilo.ts:183 - Check: Discounted Kilo routes must resolve to the correct lab base_model. Why: Stripping :discounted makes deepseek/deepseek-v4-flash:discounted and deepseek/deepseek-v4-pro:discounted resolve to undated deepseek/deepseek-v4-flash / deepseek/deepseek-v4-pro. Existing discounted entries are named “V4 Flash 0731” and “V4 Pro 0813”, and Kilo already factors the dated IDs onto deepseek/deepseek-v4-flash-0731 and deepseek/deepseek-v4-pro-0813. Auto-factoring onto the undated lab entries would inherit the wrong release metadata and identity. Action: Verify against Kilo’s API which lab snapshot each :discounted route serves; if they are the 0731/0813 builds, add explicit canonical overrides (or map discounted IDs to the dated bases) instead of only stripping the suffix.
  • [medium] [violation] packages/core/src/sync/providers/kilo.ts:183 - Check: Sync behavior changes need regression coverage when they create a concrete untested failure mode. Why: buildKiloModel had no tests before, and this PR changes both canonical resolution and route-variant name preservation for :discounted / :free. Those paths are easy to regress (suffix handling, wrong base_model, dropped route-specific names) with no coverage in packages/core/test/sync.test.ts. Action: Add focused unit tests for :discounted (and :free) that assert base_model resolution and that route-variant name is preserved when factoring.

@github-actions github-actions Bot added the reviewer: ready Automated review found no actionable items label Aug 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

reviewer: ready Automated review found no actionable items

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant