feat: add TelecomJS provider support with configuration and catalog i…#4370
Open
baendlorel wants to merge 1 commit into
Open
feat: add TelecomJS provider support with configuration and catalog i…#4370baendlorel wants to merge 1 commit into
baendlorel wants to merge 1 commit into
Conversation
|
Thanks @baendlorel for taking the time to contribute. This repository is observing a maintainer-managed PR intake gate in dry-run mode, so this pull request is staying open. This note helps maintainers prepare the allowlist before any enforcement is considered. Please read |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
After registering the TelecomJS (Telecom JiangSu) in the
customprovider, the model picker only shows 1 model (deepseek-v4-pro) instead of all models returned by the/v1/modelsendpoint.Root Cause
refresh_catalog_cache/fetch_catalog_deltais never invoked in production — it only exists in test code. At startup, only the Models.dev catalog is refreshed, which has no entries for telecomjs. The picker therefore falls back tomodel_completion_names_for_provider(Telecomjs), which returns only the default model.Fix
provider_lake.rs— Addmerge_live_offerings()that merges new offerings into the existing live snapshot by(provider, wire_model_id)identity rather than replacing it. This allows Models.dev rows and per-provider rows to coexist.client.rs— Addspawn_active_provider_catalog_refresh()associated function. When the active provider is Telecomjs, it spawns a background task that callsfetch_catalog_delta()(which already inherits metadata from the bundled catalog via case-insensitive matching) and merges all 52 models into the provider lake.main.rs— Call the new function at startup, after the existingmodels_dev_live::spawn_background_refresh().config.rs— Expand themodel_completion_names_for_provider(Telecomjs)fallback list from 1 to 11 models, so the picker shows useful options even before the background refresh completes.Testing
cargo check --workspace— passcargo test -p codewhale-config— 360 tests passedcargo test -p codewhale-tui(provider_lake + client catalog) — 14 tests passedcargo build --release— successFinal Result