feat(llm): scheduled model catalog refresh + dynamic Anthropic catalog - #393
Merged
Merged
Conversation
Channel model lists only refreshed when an admin ran 刷新所有渠道 manually, so
preset seeds went stale and Anthropic kept a hardcoded Claude snapshot forever.
- ModelCatalogRefreshTask (IScheduledTask): refreshes all channel catalogs
every 6 hours with heartbeat tracking, reusing RefreshAllChannel
- GeneralBootstrap: fire one refresh 30s after startup so fresh deployments
pick up current provider models without waiting for the cron
- AnthropicModelApi.GetAllModels: GET {gateway}/v1/models (x-api-key +
anthropic-version headers, endpoint normalized to a single /v1), falling
back to the static snapshot on any failure; capabilities now cover the
discovered model list
- Tests: AnthropicModelDiscoveryTests (11) + ModelCatalogRefreshTaskTests (3)
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Contributor
PR Check ReportSummary
Test Results
Code Quality
Test Artifacts
LinksThis report is auto-generated by GitHub Actions |
This was referenced Sep 16, 2026
ModerRAS
added a commit
that referenced
this pull request
Sep 17, 2026
Resolve #395 conflicts after #393/#394 were squash-merged: - LlmProviderCatalog / IEditLLMConfHelper / EditLLMConfHelper / EditLLMConfTest: keep the branch side (step 2 + step 3/4 content is the superset) - GeneralBootstrap: keep master's startup catalog refresh (#393) and re-add the providers.json source log from step 3 Validated after merge: build 0 errors; LLM.Test 310/310; main tests 455 passed / 1 skipped
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.
Why
Channel model lists were only refreshed when an admin ran
刷新所有渠道by hand, andAnthropicModelApireturned a hardcoded Claude snapshot forever. Preset seeds therefore went stale and nobody noticed.What
ModelCatalogRefreshTask(IScheduledTask, every 6 hours, heartbeat-managed) reusesRefreshAllChannel; manual刷新所有渠道stays as-is.GeneralBootstrapfires one refresh 30 s after host start, so a fresh deployment gets current provider models without waiting for the cron.GET {gateway}/v1/modelswithx-api-key+anthropic-version, endpoint normalized to exactly one/v1(works forapi.anthropic.comand compatible gateways likeopencode.ai/zen/v1); HTTP error, empty list or invalid JSON falls back to the static snapshot.GetAllModelsWithCapabilitiesnow covers the discovered list.Validation
dotnet build TelegramSearchBot.sln -c Release→ 0 errorsTelegramSearchBot.LLM.Test→ 278/278 (11 new Anthropic discovery tests)TelegramSearchBot.Test→ 448 passed, 1 skipped (3 new task tests)Notes