feat: add TelecomJS provider support with configuration and catalog i…#4370
feat: add TelecomJS provider support with configuration and catalog i…#4370baendlorel wants to merge 2 commits 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 |
|
Thanks @baendlorel—this is a real v0.9.1 gap, and the PR is now in the v0.9.1 queue. Current I reviewed the current patch against
Please also:
The provider wiring and production refresh direction are worth preserving. If you no longer have time to refresh the branch, say so here and we can harvest the commit onto current main while retaining your authorship and credit. |
|
The TelecomJS live-model gap is still real, but this branch is not safe to merge as written. It races the single replaceable live snapshot, so a later Models.dev refresh can erase TelecomJS rows; it also borrows metadata from the first case-insensitive model-ID match across unrelated providers. Please rebuild on current main with source-scoped snapshots, both refresh-order tests, conservative unknown metadata, actual TelecomJS request-shape proof, DCO, and current CI. Contributor credit will be preserved if harvested. |
|
Thanks for digging into this — your root-cause analysis is confirmed correct: This PR can't merge in its current form, and we're retargeting it out of v0.9.1 to v0.9.2, for four concrete reasons:
Path forward: the catalog-state rewrite lands via #4462 first; then this PR can be rebased down to just the TelecomJS provider preset (endpoints, default models, honest unknown metadata) on top of it. If you'd like to take the preset slice after #4462 lands, it's yours — say so and we'll assign it to you. |
I've worked through the changes requested in your first review and pushed them to this branch (commit 85f674c). Summary: Source-scoped live snapshots: provider_lake.rs now partitions the live snapshot by source (ModelsDev and per_provider), so a later Models.dev refresh no longer overwrites TelecomJS rows. Added deterministic tests for both completion orders (Models.dev→TelecomJS and TelecomJS→Models.dev). |
…ire_model_id metadata + remove TelecomJS reasoning injection - Partition LIVE_SNAPSHOT into Models.dev and per-provider partitions to prevent Models.dev refresh from clobbering TelecomJS rows (fix Hmbown#1). - Two-tier wire_model_id matching: same-provider inherits full metadata, cross-provider inherits only family name derivation (fix Hmbown#2). - Remove TelecomJS from apply_reasoning_effort branches; TokenHub API does not support reasoning_effort or thinking fields (fix Hmbown#6). - Add tests: both completion orders, ambiguous wire_model_id, catalog refresh non-deletion, TelecomJS reasoning non-injection. Signed-off-by: aldia_mechdream <futami16237@gmail.com>
bfa5d41 to
85f674c
Compare
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