mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2026-07-05 21:50:46 +08:00
### What this PR does Before this PR: - Grok 4.3 did not fully support reasoning effort through the xAI responses path. - Cherry Studio did not expose the Grok 4.3 reasoning options consistently in model configuration. - The local @ai-sdk/xai patch could fail pnpm install after manual patch edits. After this PR: - Grok 4.3 correctly maps `reasoning_effort` to xAI responses with `none`, `low`, `medium`, and `high`. - The renderer exposes Grok 4.3 as a supported reasoning model with the correct option set. - The local @ai-sdk/xai patch is regenerated and narrowed to the responses path so pnpm install succeeds. Fixes # N/A ### Why we need it and why it was done in this way The following tradeoffs were made: - The change is scoped to the xAI responses path because Grok is already routed to `xai-responses` in this repository. - A local patch is still required because the latest stable `@ai-sdk/xai` release does not yet support `none` for xAI responses `reasoningEffort`. - The patch was narrowed to responses-only to avoid widening behavior for the base xAI chat path. The following alternatives were considered: - Upgrading directly to the latest stable `@ai-sdk/xai`, but the latest stable release still does not support `none` for responses `reasoningEffort`. - Broadening the patch to cover xAI chat options as well, but that would expand behavior beyond the required Grok 4.3 responses path. Links to places where the discussion took place: None ### Breaking changes None. If this PR introduces breaking changes, please describe the changes and the impact on users. ### Special notes for your reviewer - Focused validation passed with `pnpm install`, `pnpm typecheck:web`, and targeted Vitest suites for xAI/Grok reasoning and model config. - Full `pnpm test` on Windows still has unrelated baseline failures outside this change set. ### 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 <!-- 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 Fixed Grok 4.3 reasoning effort support in xAI responses so Cherry Studio now correctly exposes and applies the `none`, `low`, `medium`, and `high` reasoning levels. ``` --------- Signed-off-by: ousugo <dkzydkzyxh@gmail.com> Co-authored-by: ousugo <dkzydkzyxh@gmail.com> Co-authored-by: SuYao <sy20010504@gmail.com>
2.4 KiB
2.4 KiB