Skip to content

feat: add TelecomJS provider support with configuration and catalog i…#4370

Open
baendlorel wants to merge 1 commit into
Hmbown:mainfrom
baendlorel:feat/provider-telecomjs
Open

feat: add TelecomJS provider support with configuration and catalog i…#4370
baendlorel wants to merge 1 commit into
Hmbown:mainfrom
baendlorel:feat/provider-telecomjs

Conversation

@baendlorel

Copy link
Copy Markdown

Problem

After registering the TelecomJS (Telecom JiangSu) in the custom provider, the model picker only shows 1 model (deepseek-v4-pro) instead of all models returned by the /v1/models endpoint.

Root Cause

refresh_catalog_cache/fetch_catalog_delta is 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 to model_completion_names_for_provider(Telecomjs), which returns only the default model.

Fix

  1. provider_lake.rs — Add merge_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.

  2. client.rs — Add spawn_active_provider_catalog_refresh() associated function. When the active provider is Telecomjs, it spawns a background task that calls fetch_catalog_delta() (which already inherits metadata from the bundled catalog via case-insensitive matching) and merges all 52 models into the provider lake.

  3. main.rs — Call the new function at startup, after the existing models_dev_live::spawn_background_refresh().

  4. config.rs — Expand the model_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 — pass
  • cargo test -p codewhale-config — 360 tests passed
  • cargo test -p codewhale-tui (provider_lake + client catalog) — 14 tests passed
  • cargo build --release — success

Final Result

codewhale增加江苏tokenhub

@baendlorel baendlorel requested a review from Hmbown as a code owner July 15, 2026 03:05
@github-actions

Copy link
Copy Markdown

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 CONTRIBUTING.md for the expected contribution shape. A maintainer can grant recurring PR access by commenting /lgtm on a pull request.

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