feat(data): migrate provider/model data and finalize provider APIs#14034
Closed
jidan745le wants to merge 34 commits intoCherryHQ:v2from
Closed
feat(data): migrate provider/model data and finalize provider APIs#14034jidan745le wants to merge 34 commits intoCherryHQ:v2from
jidan745le wants to merge 34 commits intoCherryHQ:v2from
Conversation
Signed-off-by: jidan745le <420511176@qq.com>
Add v2 provider-model migration mappings and registration, then align provider handlers/services with lifecycle DI and API contracts so migration generation and node typecheck both pass. Signed-off-by: jidan745le <420511176@qq.com> Made-with: Cursor
Add an empty changeset file so CI changeset-check passes for this non-release provider/model runtime integration work. Signed-off-by: jidan745le <420511176@qq.com> Made-with: Cursor
…path Drop redundant assertions flagged by oxlint and keep only required runtime-shape casts so CI test:lint passes. Signed-off-by: jidan745le <420511176@qq.com> Made-with: Cursor
Remove duplicate 0007 migration and regenerate migration artifacts as 0009 to keep drizzle journal order consistent with existing 0007/0008 chain. Signed-off-by: jidan745le <420511176@qq.com> Made-with: Cursor
The catalog service initialization was missing from the startup sequence, causing preset provider/model data (capabilities, context windows, pricing, baseUrls) to never sync from protobuf catalog files into SQLite on each launch. Signed-off-by: jidan745le <420511176@qq.com>
Collaborator
|
Note This issue/comment/review was translated by Claude. No renaming. Original Content没有重命名 |
DeJeune
reviewed
Apr 5, 2026
DeJeune
requested changes
Apr 5, 2026
Collaborator
Author
|
Note This issue/comment/review was translated by Claude. No renaming. Original Content我确认下 这个是不是说文件夹名 provider-catalog 改成 catalog-registry |
Signed-off-by: jidan745le <420511176@qq.com>
…thub.com/jidan745le/cherry-studio into feat/v2/provider-catalog-runtime-minimal
Collaborator
provider-registry |
Signed-off-by: jidan745le <420511176@qq.com>
Signed-off-by: jidan745le <420511176@qq.com>
… DataApi Signed-off-by: jidan745le <420511176@qq.com>
Signed-off-by: jidan745le <420511176@qq.com>
Signed-off-by: jidan745le <420511176@qq.com>
Signed-off-by: jidan745le <420511176@qq.com>
Signed-off-by: jidan745le <420511176@qq.com>
Signed-off-by: jidan745le <420511176@qq.com>
…dpointConfigs Merge three separate provider endpoint fields into a single `endpointConfigs` map keyed by EndpointType. Each entry holds baseUrl, modelsApiUrls, and reasoningFormatType in one place. Also removes unused `createdAt` from ApiKeyEntry. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: suyao <sy20010504@gmail.com>
Rename the entire provider-catalog package, service, and all related references to provider-registry for clearer naming semantics. - Package: @cherrystudio/provider-catalog → @cherrystudio/provider-registry - Directory: packages/provider-catalog → packages/provider-registry - Proto namespace: catalog.v1 → registry.v1 - Service: ProviderCatalogService → ProviderRegistryService - All type/function/variable names updated accordingly Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: suyao <sy20010504@gmail.com>
rateLimit depends on the user's API plan, not the model itself — not appropriate for preset registry data. Also remove inherited reserved fields since registry.v1 has no legacy data to maintain compatibility with. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: suyao <sy20010504@gmail.com>
…I design - Convert RegistryService to lifecycle-managed ProviderRegistryService (@Injectable, @ServicePhase, @dependsOn, BaseService) - Register in serviceRegistry.ts; remove manual init from index.ts - Replace singleton imports with application.get('ProviderRegistryService') - Move /models/resolve to POST /providers/:providerId/registry-models (RESTful: same resource path, different HTTP methods) - Rename ResolveModelsDto to EnrichModelsDto (providerId from URL params) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: suyao <sy20010504@gmail.com>
…-minimal' into feat/v2/provider-renderer-on-minimal
…odel Migrate renderer consumer code to match the new consolidated endpointConfigs schema (replaces separate baseUrls, modelsApiUrls, reasoningFormatTypes fields) and catalog→registry rename. - Replace provider.baseUrls?.[ep] with endpointConfigs?.[ep]?.baseUrl in ProviderSetting, CherryINSettings, DMXAPISettings, ManageModelsPopup - Rename replaceBaseUrlDomain → replaceEndpointConfigDomain (preserves other EndpointConfig fields like reasoningFormatType) - Update v1ProviderShim to read baseUrl from endpointConfigs - Rename useProviderCatalogModels → useProviderRegistryModels, update endpoint from catalog-models to registry-models - Replace removed /models/resolve with /providers/:id/registry-models POST - Update tests to reflect all of the above Signed-off-by: jidan745le <420511176@qq.com>
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
6 tasks
This comment was marked as resolved.
This comment was marked as resolved.
…ings - Remove protobuf toolchain (proto files, buf config, generated code, @bufbuild/* dependencies) - Convert registry data from .pb binary to .json files - Replace proto-generated types with Zod-inferred types - Rewrite registry-reader to use JSON.parse + Zod validation - Simplify ProviderRegistryService and modelMerger by removing proto conversion layers (buildEndpointConfigsFromProto, CASE_TO_TYPE, extractReasoningFormatType) - Convert all enums from numeric TypeScript enum to string-valued as-const objects (EndpointType, ModelCapability, Modality, Currency, ReasoningEffort) for debuggability - Regenerate Drizzle migration to match current schema Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: suyao <sy20010504@gmail.com>
The registry data uses "2026.03.09" format (from proto), but the VersionSchema regex only allowed "YYYY-MM-DD". This caused Zod validation to fail silently when loading registry JSON, resulting in empty model data and no enrichment of capabilities/modalities. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: suyao <sy20010504@gmail.com>
registry-reader.ts uses node:fs which crashes in renderer. Split into a separate @cherrystudio/provider-registry/node sub-path export so the main entry stays browser-compatible. Also fix endpointType casts from number to string in renderer popups. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: suyao <sy20010504@gmail.com>
This comment was marked as outdated.
This comment was marked as outdated.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: suyao <sy20010504@gmail.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: suyao <sy20010504@gmail.com>
- Add void to all floating promises in ProviderSettings components - Remove closeDelay prop (not in TooltipProps) - Fix unused destructured variable with delete pattern Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: suyao <sy20010504@gmail.com>
Collaborator
- ManageModelsPopup: replace Math.floor(Number(defaultChatEndpoint)) with direct string enum access (was producing NaN after string enum migration, causing model list to fail loading) - provider.v2.ts: fix replaceEndpointConfigDomain type signature from Record<number, ...> to Record<EndpointType, ...>, remove Number(key) conversions - Update test file to use string EndpointType keys Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: suyao <sy20010504@gmail.com>
…-render loop When data is undefined (loading), `data ?? []` created a new array reference on every render, causing ModelList's useEffect to loop indefinitely via setDisplayedModelGroups with a new object each cycle. Use a module-level EMPTY_MODELS constant with useMemo, matching the pattern already used by useProviders. Signed-off-by: jidan745le <420511176@qq.com> Made-with: Cursor
Signed-off-by: jidan745le <420511176@qq.com> Made-with: Cursor
6 tasks
DeJeune
added a commit
that referenced
this pull request
Apr 10, 2026
…nd only) (#14115) ### What this PR does Before this PR: - v2 migration did not include provider/model data migration from legacy `llm` state. - Provider/model data APIs and handlers were incomplete. - `@cherrystudio/provider-registry` (formerly provider-catalog) package was not integrated into the data layer. After this PR: - Add provider/model migration path (`ProviderModelMigrator` + mappings) and register it in v2 migrator flow. - Add `@cherrystudio/provider-registry` package with JSON-based registry data, Zod-validated schemas, and lifecycle-managed `ProviderRegistryService`. - Complete provider/model schemas, services, handlers, shared API schemas/types, and model merger utility. - Complete provider API endpoints (`registry-models`, `auth-config`, `api-keys`) aligned with lifecycle DI patterns. **Note:** This PR is intentionally scoped to backend/data-layer only. Renderer consumer migration will be submitted in a separate PR to maintain domain separation. Fixes # N/A ### Why we need it and why it was done in this way The following tradeoffs were made: - Kept migration and data API implementation within current v2 architecture (handler -> service -> db schema) instead of adding temporary compatibility layers. - Replaced protobuf toolchain with JSON + Zod validation for simpler data pipeline and better debuggability. - Converted all numeric enums to string-valued `as-const` objects (EndpointType, ModelCapability, Modality, etc.) for runtime debuggability. - Unified separate `baseUrls`, `modelsApiUrls`, `reasoningFormatTypes` fields into a single `endpointConfigs` map keyed by EndpointType. The following alternatives were considered: - Keep protobuf-based registry data; rejected due to complexity of proto toolchain and poor debuggability of binary data. - Include renderer consumer migration in same PR; deferred to separate PR for cleaner domain boundaries. Links to places where the discussion took place: - Original combined PR: #14034 ### Breaking changes None. ### Special notes for your reviewer - This is a backend-only extraction from #14034, which contained both backend and renderer consumer code. The renderer migration will follow in a separate PR. - Please focus review on migration flow (`ProviderModelMigrator`), provider/model service contracts, and the registry package design. - The `@cherrystudio/provider-registry` package was renamed from `provider-catalog` and uses JSON data files instead of protobuf. ### Checklist - [x] PR: The PR description is expressive enough and will help future contributors - [x] Code: Write code that humans can understand and Keep it simple - [x] Refactor: You have left the code cleaner than you found it (Boy Scout Rule) - [ ] Upgrade: Impact of this change on upgrade flows was considered and addressed if required - [ ] Documentation: Not required (internal data layer, no user-facing changes) - [x] Self-review: I have reviewed my own code ### Release note ```release-note NONE ``` --------- Signed-off-by: jidan745le <420511176@qq.com> Signed-off-by: suyao <sy20010504@gmail.com> Co-authored-by: suyao <sy20010504@gmail.com> Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com> Co-authored-by: fullex <106392080+0xfullex@users.noreply.github.com>
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.

What this PR does
Before this PR:
llmstate.@cherrystudio/provider-catalogruntime integration and related data-layer files were not fully wired for this branch.After this PR:
ProviderModelMigrator+ mappings) and register it in v2 migrator flow.catalog-models,auth-config,api-keys) and align services with lifecycle DI patterns.Fixes #
None
Why we need it and why it was done in this way
The following tradeoffs were made:
The following alternatives were considered:
Links to places where the discussion took place:
Breaking changes
None.
Special notes for your reviewer
upstream/v2and conflict-resolved.ProviderModelMigrator) and provider/model service contracts.Checklist
This checklist is not enforcing, but it's a reminder of items that could be relevant to every PR.
Approvers are expected to review this list.
/gh-pr-review,gh pr diff, or GitHub UI) before requesting review from othersRelease note