feat: add Tencent Cloud TokenHub provider with auto model sync
ci / tcc-check (push) Successful in 1m5s
ci / linux (aarch64, 0) (push) Failing after 48s
ci / linux (x86, 1) (push) Failing after 1h0m2s
ci / linux (x86_64, 1) (push) Failing after 1h0m2s
ci / windows (push) Failing after 51s

Fetch GET /v1/models on provider/key switch, activate online chat models,
and accept HERMIT_/CST_ key env aliases plus tencent* provider names.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
WHC
2026-11-03 21:18:39 +08:00
co-authored by Cursor
parent 5538ed3412
commit 88feddd794
8 changed files with 187 additions and 22 deletions
+14 -1
View File
@@ -143,7 +143,15 @@ int main(void) {
"{\"id\":\"vllm-model\",\"max_model_len\":32768,"
"\"modalities\":{\"input\":[\"text\"]}},"
"{\"id\":\"plain\"}]}");
g_nresp = 6;
/* TokenHub-style: status + non-chat ids */
g_responses[6] = RESP(
"200 OK",
"{\"object\":\"list\",\"data\":["
"{\"id\":\"hy3\",\"status\":\"online\"},"
"{\"id\":\"gone\",\"status\":\"offline\"},"
"{\"id\":\"text-embedding-v1\",\"status\":\"online\"},"
"{\"id\":\"deepseek-v4-pro\",\"status\":\"pre-offline\"}]}");
g_nresp = 7;
int port = start_server();
pthread_t th;
CHECK(pthread_create(&th, NULL, serve, NULL) == 0);
@@ -185,6 +193,11 @@ int main(void) {
CHECK(meta[2].context == 32768 && meta[2].vision == 0);
CHECK(meta[3].vision == -1 && meta[3].context == 0 && !meta[3].has_price);
n = cst_llm_list_models(base, "sk-test", ids, 8, err, sizeof(err));
CHECK(n == 2);
CHECK(strcmp(ids[0], "hy3") == 0);
CHECK(strcmp(ids[1], "deepseek-v4-pro") == 0);
pthread_join(th, NULL);
test_sock_close(g_listen);