### What this PR does
Before this PR:
- Selecting Claude Opus 4.7 (`claude-opus-4-7`) in Cherry Studio could
not work:
- The model is not in the catalog, so users could only add it manually
as a custom model.
- With reasoning enabled, Cherry would send `effort: 'max'` (4.6
mapping) instead of the native `xhigh` that 4.7 supports, and
`thinking.display` would default to `omitted` — stripping reasoning text
from the response and breaking Cherry's thinking UI.
- Temperature and top_p were still sent when `reasoning_effort` was
`default` or `none`, which Opus 4.7 rejects with HTTP 400 regardless of
reasoning settings.
- `getMaxTokens` subtracted a thinking budget for 4.6 / 4.7 (both use
adaptive thinking and do not send `budgetTokens`), incorrectly shrinking
`max_tokens`.
After this PR:
- `claude-opus-4-7` is catalogued under the Anthropic provider with a
128K output-token limit, routed through the existing `claude46`
reasoning-effort type so it shares the `[low, medium, high, xhigh]`
option list.
- Opus 4.7 sends native `xhigh` to Anthropic (Opus 4.6 still sends
`max`). Bedrock continues to map `xhigh → 'max'` until
`@ai-sdk/amazon-bedrock` adds `xhigh`.
- Adaptive thinking defaults to `display: 'summarized'` on Opus 4.7, so
reasoning text continues to stream back for Cherry's UI.
- `temperature` and `top_p` are dropped unconditionally for Opus 4.7 in
`getTemperature` / `getTopP`.
- `getMaxTokens` skips the budget subtraction for both 4.6 and 4.7
(shared adaptive-thinking path).
- At the agent-session dispatch site, `effort: 'xhigh'` is mapped to
`'max'` and the `display` field is stripped before reaching the Claude
Agent SDK (whose types do not yet include them).
Fixes #
### Why we need it and why it was done in this way
The following tradeoffs were made:
- Opus 4.7 shares the `claude46` thinking model type (same effort
options) instead of introducing a new `claude47` enum member. This
avoids churn in `ThinkingModelType` / `MODEL_SUPPORTED_OPTIONS`, and the
provider-boundary mapping (xhigh → native on 4.7, xhigh → max on 4.6)
cleanly expresses the only real difference.
- `thinking.display` is defaulted to `'summarized'` so existing Cherry
behavior (reasoning text streamed to the UI) is preserved. The Anthropic
API default is `'omitted'`, which would silently remove reasoning
content.
- `getMaxTokens` fix for 4.6 is applied alongside 4.7 because the same
code path is touched. This is in scope for the hotfix — the 4.7 path
cannot work correctly without it.
- The agent-session call site performs a local narrowing (`xhigh →
'max'`, strip `display`) rather than extending `AgentEffort` /
`AgentThinkingConfig` schemas. This keeps the change small and
compatible with the currently installed `@anthropic-ai/claude-agent-sdk`
type shape.
The following alternatives were considered:
- Introducing a new `claude47` `ThinkingModelType` variant and dedicated
option lists. Rejected — the effort list is identical to 4.6; a new
variant would duplicate data without adding behavior.
- Wiring `taskBudget` support (the agentic-workflow token budget
introduced in the same Vercel AI SDK PR). Intentionally out of scope —
Cherry has no UI or call site that would supply one, and it is not a
hotfix-class concern.
- Extending `AgentEffortSchema` and `AgentThinkingConfigSchema`
end-to-end. Rejected — the Claude Agent SDK still types `effort` as
`'low' | 'medium' | 'high' | 'max'` and `ThinkingAdaptive` as `{ type:
'adaptive' }`, so the schema widening would have to be undone at the SDK
boundary anyway.
Links to places where the discussion took place:
https://github.com/vercel/ai/pull/14529
### Breaking changes
None. Existing Claude 4.6 and earlier Claude models are unchanged.
### Special notes for your reviewer
- Targeted at `main` as a hotfix per the code-freeze policy. The same
fix should probably land on `v2` as well after this merges, but that is
a separate PR.
- `@ai-sdk/anthropic` is bumped to `^3.0.71` (minimum version that
exposes the Opus 4.7 / `xhigh` / `display` / `taskBudget` types). The
lockfile resolves to `3.0.71`. No other `@ai-sdk/*` packages are
touched.
- Added tests:
- `src/renderer/src/config/models/__tests__/utils.test.ts` —
`isClaude47SeriesModel` detection across direct API / Bedrock / Vertex
formats.
- `src/renderer/src/config/models/__tests__/reasoning.test.ts` —
`findTokenLimit` returns 128K for 4.7, and `getThinkModelType` routes
4.7 to `claude46`.
- `src/renderer/src/aiCore/utils/__tests__/reasoning.test.ts` —
`getAnthropicReasoningParams` returns `{ thinking: { type: 'adaptive',
display: 'summarized' }, effort: 'xhigh' }` for Opus 4.7 + xhigh, and
the `display` field is present even when no effort is set.
-
`src/renderer/src/aiCore/prepareParams/__tests__/model-parameters.test.ts`
— `getTemperature` / `getTopP` return `undefined` for Opus 4.7
regardless of reasoning settings.
- `pnpm lint` and `pnpm test` pass locally (3488 passed | 72 skipped).
One pre-existing Shiki tokenizer test is flaky under full-suite ordering
but passes in isolation and on clean `main`; unrelated to this change.
### 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.
- [x] PR: The PR description is expressive enough and will help future
contributors
- [x] Code: [Write code that humans can
understand](https://en.wikiquote.org/wiki/Martin_Fowler#code-for-humans)
and [Keep it simple](https://en.wikipedia.org/wiki/KISS_principle)
- [x] Refactor: You have [left the code cleaner than you found it (Boy
Scout
Rule)](https://learning.oreilly.com/library/view/97-things-every/9780596809515/ch08.html)
- [x] Upgrade: Impact of this change on upgrade flows was considered and
addressed if required
- [x] Documentation: A [user-guide update](https://docs.cherry-ai.com)
was considered and is present (link) or not required. Check this only
when the PR introduces or changes a user-facing feature or behavior.
- [x] Self-review: I have reviewed my own code (e.g., via
[`/gh-pr-review`](/.claude/skills/gh-pr-review/SKILL.md), `gh pr diff`,
or GitHub UI) before requesting review from others
### Release note
```release-note
Add support for Claude Opus 4.7 (`claude-opus-4-7`), including native `xhigh` reasoning effort, adaptive thinking with summarized display (so reasoning text continues to stream to the UI), and the new API requirement that `temperature` / `top_p` be omitted.
```
---------
Signed-off-by: suyao <sy20010504@gmail.com>
### What this PR does
Before this PR:
- `@ai-sdk/deepseek` was pinned to `2.0.29`, missing an upstream fix for
`deepseek-v4` reasoning content in multi-turn conversations.
After this PR:
- Bumps `@ai-sdk/deepseek` from `2.0.29` to `2.0.30` (latest stable).
- Renames the local patch file to `@ai-sdk__deepseek@2.0.30.patch` and
updates the `pnpm.patchedDependencies` key. The patch (which adds the
`reasoning_effort` option for `high`/`max`) re-applies cleanly because
the patched regions are unchanged in `2.0.30`.
Fixes #
### Why we need it and why it was done in this way
Upstream `2.0.30` ships a single fix from vercel/ai commit `0498012`:
`fix(provider/deepseek): preserve reasoning_content for deepseek-v4 in
multi-turn requests`. It threads the `modelId` into
`convertToDeepSeekChatMessages`, stops dropping `reasoning` blocks
before the last user message for `deepseek-v4`, and ensures
`reasoning_content` is at least `""` rather than `undefined` so the
field is preserved across turns. Keeping the local patch in sync with
upstream prevents drift and unblocks future DeepSeek model rollouts.
The following tradeoffs were made:
- Patch file content is byte-identical; only the filename and
`pnpm.patchedDependencies` key are updated. This avoids gratuitous diff
churn while keeping the patch addressable to the new version.
The following alternatives were considered:
- Wait for a larger DeepSeek change before bumping — rejected; the
upstream fix is small, isolated, and there is no reason to delay.
- Move to `3.0.0-beta.x` — rejected; betas track AI SDK v6 and are out
of scope for the `main` branch hotfix lane.
Links to places where the discussion took place: N/A
### Breaking changes
None. Public API surface, exported types, and the `reasoning_effort`
patch behavior are unchanged.
### Special notes for your reviewer
- Verified the patch applied to `2.0.30` in `node_modules` — both the
local addition (`reasoning_effort`) and the upstream fix
(`isDeepSeekV4`) are present after `pnpm install`.
- `pnpm build:check` passes locally (4199 tests, 0 errors).
- This change is restricted to `main` per the code-freeze policy and is
delivered from a `hotfix/*` branch with no refactoring.
### 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)
- [x] Upgrade: Impact of this change on upgrade flows was considered and
addressed if required
- [ ] Documentation: A user-guide update was considered and is present
(link) or not required. Check this only when the PR introduces or
changes a user-facing feature or behavior.
- [x] Self-review: I have reviewed my own code before requesting review
from others
### Release note
```release-note
NONE
```
---------
Signed-off-by: suyao <sy20010504@gmail.com>
<!-- Template from
https://github.com/kubevirt/kubevirt/blob/main/.github/PULL_REQUEST_TEMPLATE.md?-->
<!-- Thanks for sending a pull request! Here are some tips for you:
1. Consider creating this PR as draft:
https://github.com/CherryHQ/cherry-studio/blob/main/CONTRIBUTING.md
-->
<!--
🚨 Branch Strategy Change (Effective April 3, 2026) 🚨
The `main` branch is now under CODE FREEZE.
- main branch: Only accepts critical bug fixes via `hotfix/*` branches.
Fix PRs must be minimal in scope and must not include any refactoring
code.
- v2 branch: All new features, refactoring, and optimizations should be
submitted to the `v2` branch.
If you are submitting a bug fix to main, please ensure your PR is from a
`hotfix/*` branch.
-->
### What this PR does
Before this PR:
- `gpt-image-2` (and any image-edit request routed through AiHubMix /
NewAPI / CherryIN) failed with `common.UnmarshalBodyReusable failed:
bind request body failed: invalid character '-' in numeric literal`. The
providers hard-coded `Content-Type: application/json` in
`authHeaders()`, but `OpenAICompatibleImageModel.doGenerate` uses
`postFormDataToApi` for `/images/edits` and relies on `fetch` to
auto-set `multipart/form-data; boundary=...`. Forcing JSON made the
server receive a multipart body under a JSON content-type and choke on
the leading `--boundary`.
- Even when the request reached the server, image uploads failed with
`unsupported mimetype ('image')` because `collectImagesFromMessages`
built data URIs using `block.file.type` — which is the `FileType` enum
(`"image"`), not a MIME type.
- Some saved/pasted images produced `ENOENT: ... <uuid>jpg` because
`saveBase64Image` / `savePastedImage` return `ext` without the leading
dot, and the caller was concatenating `file.id + file.ext`.
- After a successful image generation, a `BeatLoader` placeholder kept
spinning next to the finished image. `fetchImageGeneration` only emitted
`LLM_RESPONSE_COMPLETE`; the trailing loader in `Blocks/index.tsx` is
driven by `isMessageProcessing(message)`, which is only cleared when
`onComplete` runs on `BLOCK_COMPLETE`.
- If a `file` chunk arrived without a preceding `IMAGE_CREATED`, the
initial UNKNOWN placeholder block was never claimed, leaving an orphan
spinner below the image.
- `gpt-image-2` / `gpt-image-1.5` / `gpt-image-1*` / `chatgpt-image-*`
generations through any OpenAI-compatible provider still failed with
`400 Unknown parameter: 'response_format'` (see #14485, #14540, #14579).
The earlier `@ai-sdk/openai@3.0.53` patch (#14488) only covered
`OpenAIImageModel` (direct OpenAI + Azure via `@ai-sdk/azure`);
`OpenAICompatibleImageModel.doGenerate` unconditionally added
`response_format: "b64_json"` to the `/images/generations` body, so
every provider whose image model is wired to
`OpenAICompatibleImageModel` kept hitting the 400 — including `type:
'openai-compatible'` and the AiHubMix / NewAPI / CherryIN gateway image
models in this repo.
After this PR:
- `aihubmix-provider`, `newapi-provider`, and `cherryin-provider` no
longer hard-code `Content-Type` in auth headers. `postJsonToApi` still
defaults JSON for other endpoints, and `postFormDataToApi` is free to
let `fetch` set `multipart/form-data; boundary=...` for `/images/edits`.
- `collectImagesFromMessages` reads via
`window.api.file.base64Image(block.file.name)`, which returns a correct
`data:image/<ext>;base64,...` URI (with `jpg → jpeg` normalization) and
uses the consistent on-disk filename regardless of whether the stored
`ext` has a leading dot.
- `fetchImageGeneration` now emits `ChunkType.BLOCK_COMPLETE` before
`LLM_RESPONSE_COMPLETE`, so `onComplete` runs and the assistant message
transitions out of `PROCESSING`.
- `onImageGenerated` reuses the initial UNKNOWN placeholder when one
exists, so a `file` chunk without a prior `IMAGE_CREATED` no longer
leaves an orphan spinner.
- `gpt-image-2` is registered in `IMAGE_ENHANCEMENT_MODELS`.
- `patches/@ai-sdk__openai-compatible@2.0.37.patch` is extended with the
same `hasDefaultResponseFormat` guard that `@ai-sdk/openai` already
uses. `OpenAICompatibleImageModel.doGenerate` now spreads
`response_format: "b64_json"` only when the model ID does **not** start
with `chatgpt-image-`, `gpt-image-1-mini`, `gpt-image-1.5`,
`gpt-image-1`, or `gpt-image-2`. This fixes#14485, #14540, #14579 for
`openai-compatible` typed providers and the AiHubMix / NewAPI / CherryIN
gateways.
Fixes#14485Fixes#14540Fixes#14579
### Why we need it and why it was done in this way
The following tradeoffs were made:
- The `ext`-with-or-without-dot inconsistency exists in historical DB
records, so patching only `FileStorage.ts` would not help already-saved
rows. The fix uses `file.name` at the consumer side — always the real
on-disk filename across every save path — without touching the storage
layer.
- The provider `authHeaders()` change could theoretically affect
non-JSON, non-multipart requests, but all SDK models in use go through
`postJsonToApi`, which already defaults `Content-Type: application/json`
internally, so behavior is preserved.
- Extending the `@ai-sdk/openai-compatible` patch rather than overriding
`response_format` per-provider keeps the fix in one place and
automatically covers every caller of `OpenAICompatibleImageModel`
(current and future). The guard list mirrors the upstream
`@ai-sdk/openai` list, so the two stay in sync.
The following alternatives were considered:
- Normalizing `ext` in `FileStorage.saveBase64Image` /
`savePastedImage`: rejected because it would not repair existing records
and could regress other callers that have compensated for the dotless
form.
- Overriding `Content-Type` only inside the image model factory:
rejected as more surface area than needed; the global `authHeaders()`
already defers to `postJsonToApi` defaults.
- Stripping `response_format` in each custom provider (AiHubMix / NewAPI
/ CherryIN) instead of patching the SDK: rejected — it would leave
`type: 'openai-compatible'` users still broken and duplicate the
model-prefix list in three places.
Links to places where the discussion took place: #14485, #14540, #14579,
#14488
### Breaking changes
<!-- optional -->
None.
### Special notes for your reviewer
<!-- optional -->
Scope is intentionally minimal for the main branch freeze: no
refactoring, no new abstractions. Surface changes:
- `authHeaders()` in three custom providers (drops one hard-coded
header).
- `collectImagesFromMessages` (one helper, swaps input building).
- `fetchImageGeneration` (one extra chunk emission).
- `onImageGenerated` (placeholder-claim fallback).
- `IMAGE_ENHANCEMENT_MODELS` (one new entry).
- `patches/@ai-sdk__openai-compatible@2.0.37.patch` (adds
`hasDefaultResponseFormat` helper + conditional spread of
`response_format`; mirrors `@ai-sdk/openai@3.0.53` patch).
Drop the openai-compatible patch addition once
`@ai-sdk/openai-compatible` ships the equivalent check upstream.
### 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.
- [x] PR: The PR description is expressive enough and will help future
contributors
- [x] Code: [Write code that humans can
understand](https://en.wikiquote.org/wiki/Martin_Fowler#code-for-humans)
and [Keep it simple](https://en.wikipedia.org/wiki/KISS_principle)
- [x] Refactor: You have [left the code cleaner than you found it (Boy
Scout
Rule)](https://learning.oreilly.com/library/view/97-things-every/9780596809515/ch08.html)
- [x] Upgrade: Impact of this change on upgrade flows was considered and
addressed if required
- [ ] Documentation: A [user-guide update](https://docs.cherry-ai.com)
was considered and is present (link) or not required. Check this only
when the PR introduces or changes a user-facing feature or behavior.
- [x] Self-review: I have reviewed my own code (e.g., via
[`/gh-pr-review`](/.claude/skills/gh-pr-review/SKILL.md), `gh pr diff`,
or GitHub UI) before requesting review from others
### Release note
<!-- Write your release note:
1. Enter your extended release note in the below block. If the PR
requires additional action from users switching to the new release,
include the string "action required".
2. If no release note is required, just write "NONE".
3. Only include user-facing changes (new features, bug fixes visible to
users, UI changes, behavior changes). For CI, maintenance, internal
refactoring, build tooling, or other non-user-facing work, write "NONE".
-->
```release-note
Fix image generation and editing for gpt-image-2 / gpt-image-1.5 / gpt-image-1* / chatgpt-image-* across AiHubMix, NewAPI, CherryIN, Azure OpenAI, and other OpenAI-compatible providers: requests no longer fail with `Unknown parameter: 'response_format'`, multipart content-type, or mimetype errors; generated/pasted images are resolved correctly; and the loading placeholder disappears once the image is rendered.
```
---------
Signed-off-by: suyao <sy20010504@gmail.com>
### What this PR does
Before this PR:
Calling the newly-released `gpt-image-2` model (shipped 2026-04-21) via
OpenAI image generation fails with `400 Unknown parameter:
'response_format'`. `@ai-sdk/openai@3.0.49` (our current AI SDK v6 line
dep) unconditionally sends `response_format: 'b64_json'` for any model
not in its `defaultResponseFormatPrefixes` allow-list, and `gpt-image-2`
is not in that list.
After this PR:
`@ai-sdk/openai@3.0.49` is patched to add `gpt-image-2` to both
`modelMaxImagesPerCall` and `defaultResponseFormatPrefixes` in all four
compiled dist entry points (`dist/index.{js,mjs}`,
`dist/internal/index.{js,mjs}`). This mirrors vercel/ai#14680, which was
backported to `release-v6.0` via vercel/ai#14682 on 2026-04-21 but has
not yet been published to npm. The patch is registered in
`pnpm.patchedDependencies` alongside the existing AI SDK patches.
Fixes#14485
### Why we need it and why it was done in this way
The upstream fix (vercel/ai#14680 / #14682) is already merged into the
`release-v6.0` branch, so a patch is a stable, low-risk equivalent of
the forthcoming `@ai-sdk/openai@3.0.54+`. Once that version ships on
npm, this patch can be dropped and replaced with a dependency bump.
The following tradeoffs were made:
- Patching compiled `dist/` files instead of source: matches the
repository's existing convention (see
`patches/@ai-sdk__google@3.0.55.patch`,
`patches/@ai-sdk__openai-compatible@2.0.37.patch`) and avoids rebuilding
the package.
- Not touching `.d.ts` type declarations: the upstream
`OpenAIImageModelId` union already accepts `(string & {})`, so runtime
behavior is the only thing that needs correcting.
The following alternatives were considered:
- Waiting for the npm release of `@ai-sdk/openai@3.0.54` — rejected
because users are actively hitting the bug today.
- Using a pnpm `overrides` entry pointing at the `release-v6.0` git
branch — rejected because it pulls an unversioned moving target and
conflicts with the locked semver range.
- Stripping `response_format` in an `aiCore` plugin — rejected because
the fix belongs at the provider layer and a plugin would permanently
mask similar issues for other models.
Links to places where the discussion took place: vercel/ai#14680,
vercel/ai#14682
### Breaking changes
None.
### Special notes for your reviewer
- The patch adds `gpt-image-2` at the expected positions in each of the
four dist files; diff is small and mechanical. Verified locally:
`node_modules/@ai-sdk/openai/dist/index.js:1753,1761` now contain
`gpt-image-2` after `pnpm install`.
- UI model picker changes are intentionally out of scope. Users select
`gpt-image-2` by model ID today; once upstream publishes, a follow-up
can refresh `src/renderer/src/config/models/default.ts` and friends.
### Checklist
- [x] PR: The PR description is expressive enough and will help future
contributors
- [x] Code: [Write code that humans can
understand](https://en.wikiquote.org/wiki/Martin_Fowler#code-for-humans)
and [Keep it simple](https://en.wikipedia.org/wiki/KISS_principle)
- [x] Refactor: You have [left the code cleaner than you found it (Boy
Scout
Rule)](https://learning.oreilly.com/library/view/97-things-every/9780596809515/ch08.html)
- [x] Upgrade: Impact of this change on upgrade flows was considered and
addressed if required
- [ ] Documentation: A [user-guide update](https://docs.cherry-ai.com)
was considered and is present (link) or not required. Check this only
when the PR introduces or changes a user-facing feature or behavior.
- [x] Self-review: I have reviewed my own code (e.g., via
[`/gh-pr-review`](/.claude/skills/gh-pr-review/SKILL.md), `gh pr diff`,
or GitHub UI) before requesting review from others
### Release note
```release-note
fix(ai-sdk/openai): patch @ai-sdk/openai to support OpenAI's gpt-image-2 model, resolving "Unknown parameter: 'response_format'" errors.
```
---------
Signed-off-by: suyao <sy20010504@gmail.com>
This PR was opened by the [Changesets
release](https://github.com/changesets/action) GitHub action. When
you're ready to do a release, you can merge this and the packages will
be published to npm automatically. If you're not ready to do a release
yet, that's fine, whenever you add more changesets to main, this PR will
be updated.
# Releases
## @cherrystudio/ai-core@2.0.1
### Patch Changes
- [#14087](https://github.com/CherryHQ/cherry-studio/pull/14087)
[`1f72f98`](1f72f98905)
Thanks [@DeJeune](https://github.com/DeJeune)! - fix(providers):
azure-anthropic variant uses correct Anthropic toolFactories for web
search
- Add `TOutput` generic to `ProviderVariant` so `transform` output type
flows to `toolFactories` and `resolveModel`
- Add Anthropic-specific `toolFactories` to `azure-anthropic` variant
(fixes `provider.tools.webSearchPreview is not a function`)
- Fix `urlContext` factory incorrectly mapping to `webSearch` tool key
instead of `urlContext`
- Fix `BedrockExtension` `satisfies` type to use `AmazonBedrockProvider`
instead of `ProviderV3`
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
### 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>
### What this PR does
Before this PR:
Using web search with the `azure-anthropic` variant throws
`provider.tools.webSearchPreview is not a function` because it falls
back to the Azure base extension's `toolFactories`, which calls
`webSearchPreview` — a method that doesn't exist on `AnthropicProvider`.
Additionally, the `urlContext` tool factory for Anthropic incorrectly
maps `webFetch` to the `webSearch` tool key instead of `urlContext`.
After this PR:
- `azure-anthropic` variant has its own Anthropic-specific
`toolFactories` (webSearch + urlContext)
- `ProviderVariant` gains a `TOutput` generic so `transform` output type
correctly flows to `toolFactories` and `resolveModel`
- `urlContext` factory correctly maps to `urlContext` tool key (not
`webSearch`)
- `BedrockExtension` uses `AmazonBedrockProvider` instead of
`ProviderV3` in its `satisfies` type
### Why we need it and why it was done in this way
The root cause is that `ProviderVariant` typed `toolFactories` against
`TProvider` (the base provider), but `transform` can return a completely
different provider type. Adding `TOutput` generic (defaulting to
`TProvider`) lets variants declare their output type, so `toolFactories`
gets the correct type without casts.
The following tradeoffs were made:
- `variants` array type uses `ProviderVariant<TSettings, TProvider,
any>` to allow heterogeneous output types per variant
The following alternatives were considered:
- Using `unknown` + `as` casts in each toolFactory — rejected for being
less type-safe
### Breaking changes
None. The `TOutput` generic defaults to `TProvider`, so existing code is
unaffected.
### Special notes for your reviewer
The `urlContext` → `webSearch` key bug exists in the original
`AnthropicExtension` too (not just the variant), both are fixed in this
PR.
### 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: A user-guide update was considered and is present
(link) or not required
- [x] Self-review: I have reviewed my own code before requesting review
from others
### Release note
```release-note
fix: Azure Anthropic web search no longer crashes with "webSearchPreview is not a function"
```
---------
Signed-off-by: suyao <sy20010504@gmail.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-authored-by: 亢奋猫 <kangfenmao@qq.com>
- Bump @ai-sdk/* packages to latest versions and update patches
- Fix newapi provider: defer API version suffix to build phase so gemini
endpoints get /v1beta instead of /v1
- Fix Azure provider: split host formatting so azure-anthropic (Claude)
endpoints don't get the /openai suffix meant for Azure OpenAI
- Re-add @ai-sdk/google getModelPath patch (includes("models/") check)
- Support azure-openai provider type in Claude Code agent service by
auto-constructing the /anthropic base URL for Claude models
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: suyao <sy20010504@gmail.com>
This PR was opened by the [Changesets
release](https://github.com/changesets/action) GitHub action. When
you're ready to do a release, you can merge this and the packages will
be published to npm automatically. If you're not ready to do a release
yet, that's fine, whenever you add more changesets to main, this PR will
be updated.
# Releases
## @cherrystudio/ai-core@2.0.0
### Major Changes
- [#12235](https://github.com/CherryHQ/cherry-studio/pull/12235)
[`1c0a5a9`](1c0a5a95fa)
Thanks [@DeJeune](https://github.com/DeJeune)! - Migrate to AI SDK v6 -
complete rewrite of provider and middleware architecture
- **BREAKING**: Remove all legacy API clients, middleware pipeline, and
barrel `index.ts`
- **Image generation**: Migrate to native AI SDK
`generateImage`/`editImage`, remove legacy image middleware
- **Embedding**: Migrate to AI SDK `embedMany`, remove legacy embedding
clients
- **Model listing**: Refactor `ModelListService` to Strategy Registry
pattern, consolidate schema files
- **OpenRouter image**: Native image endpoint support via
`@openrouter/ai-sdk-provider` 2.3.3
- **GitHub Copilot**: Simplify extension by removing `ProviderV2` cast
and `wrapProvider`
- **Rename**: `index_new.ts` → `AiProvider.ts`, `ModelListService.ts` →
`listModels.ts`
### Patch Changes
- [#13787](https://github.com/CherryHQ/cherry-studio/pull/13787)
[`6b4c928`](6b4c928056)
Thanks [@EurFelux](https://github.com/EurFelux)! - Add missing
@openrouter/ai-sdk-provider dependency to fix package build
- [#12783](https://github.com/CherryHQ/cherry-studio/pull/12783)
[`336176b`](336176be08)
Thanks [@EurFelux](https://github.com/EurFelux)! - Baseline release for
previously unmanaged package changes while introducing changesets-based
publishing
- Updated dependencies
\[[`336176b`](336176be08)]:
- @cherrystudio/ai-sdk-provider@0.1.6
## @cherrystudio/ai-sdk-provider@0.1.6
### Patch Changes
- [#12783](https://github.com/CherryHQ/cherry-studio/pull/12783)
[`336176b`](336176be08)
Thanks [@EurFelux](https://github.com/EurFelux)! - Baseline release for
previously unmanaged package changes while introducing changesets-based
publishing
## @cherrystudio/extension-table-plus@3.0.12
### Patch Changes
- [#13840](https://github.com/CherryHQ/cherry-studio/pull/13840)
[`ae13786`](ae13786b55)
Thanks [@EurFelux](https://github.com/EurFelux)! - Add local
tsconfig.json to fix dts build failure in packages:build
- [#13817](https://github.com/CherryHQ/cherry-studio/pull/13817)
[`7c2610b`](7c2610b1e3)
Thanks [@EurFelux](https://github.com/EurFelux)! - Remove reference to
non-existent tsconfig.build.json to fix CI build failure
- [#12783](https://github.com/CherryHQ/cherry-studio/pull/12783)
[`336176b`](336176be08)
Thanks [@EurFelux](https://github.com/EurFelux)! - Baseline release for
previously unmanaged package changes while introducing changesets-based
publishing
---------
Signed-off-by: icarus <eurfelux@gmail.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: icarus <eurfelux@gmail.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Merge main branch changes including CherryClaw agent system (#13359),
new settings routes (skills, channels, scheduled-tasks), and various
fixes. Adapted merged code to v2 architecture:
- Migrated new routes to TanStack Router (file-based routing)
- Migrated TasksSettings from react-router-dom/Redux to TanStack Router/CacheService
- Migrated baseCallbacks.ts from Redux dispatch to StreamingService
- Added agent bootstrap initialization to v2 entry point
- Replaced antd Switch with @cherrystudio/ui Switch in AgentModal
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: suyao <sy20010504@gmail.com>
- Extract `modelInfo.provider` into a local `provider` variable with
an explicit undefined guard to satisfy strict null checks
- Add changeset for the AI SDK bump
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: suyao <sy20010504@gmail.com>
This PR was opened by the [Changesets
release](https://github.com/changesets/action) GitHub action. When
you're ready to do a release, you can merge this and the packages will
be published to npm automatically. If you're not ready to do a release
yet, that's fine, whenever you add more changesets to main, this PR will
be updated.
# Releases
## @cherrystudio/ai-core@2.0.0
### Major Changes
- [#12235](https://github.com/CherryHQ/cherry-studio/pull/12235)
[`1c0a5a9`](1c0a5a95fa)
Thanks [@DeJeune](https://github.com/DeJeune)! - Migrate to AI SDK v6 -
complete rewrite of provider and middleware architecture
- **BREAKING**: Remove all legacy API clients, middleware pipeline, and
barrel `index.ts`
- **Image generation**: Migrate to native AI SDK
`generateImage`/`editImage`, remove legacy image middleware
- **Embedding**: Migrate to AI SDK `embedMany`, remove legacy embedding
clients
- **Model listing**: Refactor `ModelListService` to Strategy Registry
pattern, consolidate schema files
- **OpenRouter image**: Native image endpoint support via
`@openrouter/ai-sdk-provider` 2.3.3
- **GitHub Copilot**: Simplify extension by removing `ProviderV2` cast
and `wrapProvider`
- **Rename**: `index_new.ts` → `AiProvider.ts`, `ModelListService.ts` →
`listModels.ts`
### Patch Changes
- [#13787](https://github.com/CherryHQ/cherry-studio/pull/13787)
[`6b4c928`](6b4c928056)
Thanks [@EurFelux](https://github.com/EurFelux)! - Add missing
@openrouter/ai-sdk-provider dependency to fix package build
- [#12783](https://github.com/CherryHQ/cherry-studio/pull/12783)
[`336176b`](336176be08)
Thanks [@EurFelux](https://github.com/EurFelux)! - Baseline release for
previously unmanaged package changes while introducing changesets-based
publishing
- Updated dependencies
\[[`336176b`](336176be08)]:
- @cherrystudio/ai-sdk-provider@0.1.6
## @cherrystudio/ai-sdk-provider@0.1.6
### Patch Changes
- [#12783](https://github.com/CherryHQ/cherry-studio/pull/12783)
[`336176b`](336176be08)
Thanks [@EurFelux](https://github.com/EurFelux)! - Baseline release for
previously unmanaged package changes while introducing changesets-based
publishing
## @cherrystudio/extension-table-plus@3.0.12
### Patch Changes
- [#13840](https://github.com/CherryHQ/cherry-studio/pull/13840)
[`ae13786`](ae13786b55)
Thanks [@EurFelux](https://github.com/EurFelux)! - Add local
tsconfig.json to fix dts build failure in packages:build
- [#13817](https://github.com/CherryHQ/cherry-studio/pull/13817)
[`7c2610b`](7c2610b1e3)
Thanks [@EurFelux](https://github.com/EurFelux)! - Remove reference to
non-existent tsconfig.build.json to fix CI build failure
- [#12783](https://github.com/CherryHQ/cherry-studio/pull/12783)
[`336176b`](336176be08)
Thanks [@EurFelux](https://github.com/EurFelux)! - Baseline release for
previously unmanaged package changes while introducing changesets-based
publishing
---------
Signed-off-by: icarus <eurfelux@gmail.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: icarus <eurfelux@gmail.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
### What this PR does
Before this PR:
`pnpm packages:build` fails on `extension-table-plus` because tsdown
auto-detects the root `tsconfig.json` which contains `references`,
causing `rolldown-plugin-dts` to error out.
After this PR:
A local `tsconfig.json` is added to the `extension-table-plus` package,
consistent with other packages (`aiCore`, `ai-sdk-provider`). `pnpm
packages:build` completes successfully.
Fixes the remaining issue from #13817
### Why we need it and why it was done in this way
The previous fix (#13817) removed the reference to a non-existent
`tsconfig.build.json`, but without a local tsconfig, tsdown falls back
to the root `tsconfig.json` which has `references` — incompatible with
`rolldown-plugin-dts` for dts generation.
The following tradeoffs were made: None.
The following alternatives were considered:
- Using `dts: { build: true }` in tsdown config, but adding a local
tsconfig is more consistent with other packages in the monorepo.
### Breaking changes
None.
### Special notes for your reviewer
Verified with `pnpm packages:build` — all three packages build
successfully.
### Checklist
- [x] PR: The PR description is expressive enough and will help future
contributors
- [x] Code: [Write code that humans can
understand](https://en.wikiquote.org/wiki/Martin_Fowler#code-for-humans)
and [Keep it simple](https://en.wikipedia.org/wiki/KISS_principle)
- [x] Refactor: You have [left the code cleaner than you found it (Boy
Scout
Rule)](https://learning.oreilly.com/library/view/97-things-every/9780596809515/ch08.html)
- [x] Upgrade: Impact of this change on upgrade flows was considered and
addressed if required
- [ ] Documentation: A [user-guide update](https://docs.cherry-ai.com)
was considered and is present (link) or not required. Check this only
when the PR introduces or changes a user-facing feature or behavior.
- [x] Self-review: I have reviewed my own code (e.g., via
[`/gh-pr-review`](/.claude/skills/gh-pr-review/SKILL.md), `gh pr diff`,
or GitHub UI) before requesting review from others
### Release note
```release-note
NONE
```
---------
Signed-off-by: icarus <eurfelux@gmail.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
### What this PR does
Before this PR:
The `@cherrystudio/ai-core` package imports
`@openrouter/ai-sdk-provider` in its source code (`schemas.ts` and
`types.ts`), but this dependency was not declared in
`packages/aiCore/package.json`. This caused `tsdown` to inline-bundle it
and exit with an error, failing the **Release Packages** CI workflow.
After this PR:
`@openrouter/ai-sdk-provider` is properly declared as a dependency in
`packages/aiCore/package.json`, so `tsdown` treats it as an external
dependency and the build succeeds.
Fixes #
N/A
### Why we need it and why it was done in this way
The following tradeoffs were made:
None — this is a straightforward missing dependency declaration.
The following alternatives were considered:
None.
Links to places where the discussion took place:
N/A
### Breaking changes
None.
### Special notes for your reviewer
The root `package.json` already has `@openrouter/ai-sdk-provider@^2.2.3`
with a patch applied. The aiCore package now correctly declares the same
version range so it resolves through the workspace.
### Checklist
- [x] PR: The PR description is expressive enough and will help future
contributors
- [x] Code: [Write code that humans can
understand](https://en.wikiquote.org/wiki/Martin_Fowler#code-for-humans)
and [Keep it simple](https://en.wikipedia.org/wiki/KISS_principle)
- [x] Refactor: You have [left the code cleaner than you found it (Boy
Scout
Rule)](https://learning.oreilly.com/library/view/97-things-every/9780596809515/ch08.html)
- [x] Upgrade: Impact of this change on upgrade flows was considered and
addressed if required
- [ ] Documentation: A [user-guide update](https://docs.cherry-ai.com)
was considered and is present (link) or not required. Check this only
when the PR introduces or changes a user-facing feature or behavior.
- [x] Self-review: I have reviewed my own code (e.g., via
[`/gh-pr-review`](/.claude/skills/gh-pr-review/SKILL.md), `gh pr diff`,
or GitHub UI) before requesting review from others
### Release note
```release-note
NONE
```
---------
Signed-off-by: icarus <eurfelux@gmail.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>