feat: 增加渠道级 LLM 思考模式开关#404
Merged
H-Chris233 merged 1 commit intoMay 11, 2026
Merged
Conversation
Issue Open-Less#402 needs a Settings toggle that applies to every LLM runtime path without changing prompt behavior. The implementation keeps the preference in user settings, threads it through polish, translate, QA, and validation, and sends only provider-channel request fields documented by each backend instead of prompt instructions or model-name heuristics. Constraint: Thinking controls are provider-specific request fields, not a portable prompt convention Rejected: Prompt-level thinking instructions | changes model-facing prompts and cannot guarantee provider thinking mode Rejected: Per-model allow/deny lists | user requested channel-level behavior and provider-side handling for unsupported models Confidence: medium Scope-risk: moderate Directive: Do not add prompt injection or model-name thinking adapters for Open-Less#402 without a new explicit product decision Tested: cargo test --manifest-path openless-all/app/src-tauri/Cargo.toml --lib openai_chat_body -- --nocapture Tested: cd openless-all/app && cargo test --manifest-path src-tauri/Cargo.toml --lib disabled_thinking_config -- --nocapture Tested: cd openless-all/app && cargo test --manifest-path src-tauri/Cargo.toml --lib build_generate_body -- --nocapture Tested: cd openless-all/app && cargo check --manifest-path src-tauri/Cargo.toml Tested: cd openless-all/app && npm run build Tested: git diff --check Related: Open-Less#402
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
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.
User description
概要
Closes #402
本 PR 在 LLM 设置里补齐“思考模式”开关,并把开关贯通到所有 LLM 调用路径:润色、翻译、QA 流式回答和设置页连接验证。
实现方式
llmThinkingEnabled用户偏好,并通过前端设置页切换保存。reasoning_effortreasoning.effortenable_thinkingthinking.typegenerateContent/streamGenerateContent,用原生thinkingConfig做渠道级控制。reasoning.effort。文档核对
验证
cargo test --manifest-path openless-all/app/src-tauri/Cargo.toml --lib openai_chat_body -- --nocapturecd openless-all/app && cargo test --manifest-path src-tauri/Cargo.toml --lib codex_oauth -- --nocapturecd openless-all/app && cargo test --manifest-path src-tauri/Cargo.toml --lib disabled_thinking_config -- --nocapturecd openless-all/app && cargo test --manifest-path src-tauri/Cargo.toml --lib build_generate_body -- --nocapturecd openless-all/app && cargo check --manifest-path src-tauri/Cargo.tomlcd openless-all/app && npm run buildgit diff --check备注:Rust 与 Vite 输出均只剩仓库既有 warning。
PR Type
Enhancement, Tests
Description
Add channel-level LLM thinking toggle in settings
Pass thinking flag to polish, translate, QA, and validation
Inject provider‑specific thinking fields (OpenAI, DeepSeek, Alibaba, Gemini, OpenRouter, Codex)
Simplify Gemini thinking to channel‑level budget config, dropping per‑model table
Diagram Walkthrough
File Walkthrough
8 files
Read thinking preference and pass to provider configsThread thinking flag through polish/translate/QA pathsPass thinking preference to dictation session handlingSimplify Gemini thinking control to channel‑level budgetAdd channel‑specific thinking control fields for OpenAI‑compatibleAdd llm_thinking_enabled field to UserPreferencesAdd llmThinkingEnabled to frontend UserPreferences typeAdd thinking toggle UI component in settings5 files
Add English translations for thinking mode toggleAdd Japanese translations for thinking modeAdd Korean translations for thinking modeAdd Chinese translations for thinking modeAdd Traditional Chinese translations2 files
Add llmThinkingEnabled to mock settingsInclude thinking field in test preferences