Conversation
Support dynamic props
- Introduced a ReasoningToggle component to enable/disable reasoning mode. - Updated settings to include reasoningEnabled option. - Enhanced chat message handling to parse thinking blocks. - Modified AI service and request builders to support reasoning in requests. - Updated response parsers to handle reasoning content from various providers. - Added translations for reasoning-related terms in multiple languages.
There was a problem hiding this comment.
Pull request overview
Adds a cross-provider “reasoning/thinking” mode to SnapMind’s chat flow, including request shaping, response parsing, and UI rendering of model “thinking” segments, plus a small dev-mode auto-update behavior tweak.
Changes:
- Introduces
reasoningEnabledchat setting and plumbs areasoningflag through provider options/builders (OpenAI-compatible, Azure, Google/Gemini, Anthropic). - Enhances stream/non-stream parsers to capture provider-specific reasoning/thought fields and wrap them in
<think>...</think>markers. - Updates the renderer to toggle reasoning mode and display extracted thinking content in a collapsible UI.
Reviewed changes
Copilot reviewed 28 out of 30 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| src/types/setting.d.ts | Adds reasoningEnabled to chat settings type. |
| src/types/providers.d.ts | Adds reasoning option; extends request builder header API to accept options. |
| src/services/providers/UnifiedProvider.ts | Passes provider options into buildChatHeaders for beta/feature headers. |
| src/services/providers/parsers/openaiResponseParser.ts | Parses reasoning_content and wraps it in <think> markers. |
| src/services/providers/parsers/googleResponseParser.ts | Parses Gemini thought parts and wraps them in <think> markers. |
| src/services/providers/parsers/anthropicResponseParser.ts | Parses Anthropic thinking blocks and emits <think> markers. |
| src/services/providers/adapters/openaiRequestBuilder.ts | Builds special request body for reasoning models (max_completion_tokens, etc.). |
| src/services/providers/adapters/azureRequestBuilder.ts | Builds Azure reasoning request body using max_completion_tokens. |
| src/services/providers/adapters/googleRequestBuilder.ts | Adds Gemini thinkingConfig when reasoning is enabled. |
| src/services/providers/adapters/anthropicRequestBuilder.ts | Adds beta header + extended thinking config when reasoning is enabled. |
| src/services/providers/tests/OpenAIProvider.test.ts | Tests reasoning-content parsing in stream/non-stream cases. |
| src/services/providers/tests/GoogleProvider.test.ts | Tests thought-part parsing in stream/non-stream cases. |
| src/services/providers/tests/AnthropicProvider.test.ts | Tests thinking-block parsing in stream/non-stream cases. |
| src/services/AIService.ts | Plumbs reasoning flag (from settings or override) into provider options. |
| src/pages/Settings/SettingsChat.tsx | Adds settings UI toggle for reasoning mode. |
| src/pages/Settings/SettingsCategory.tsx | Adds textValue for accessibility. |
| src/pages/Settings/Models/SettingsModels.tsx | Adds textValue for accessibility. |
| src/pages/ChatPopup/ChatPopup.tsx | Adds reasoning toggle in chat popup; minor UI/layout changes; improves select item accessibility. |
| src/pages/ChatMessage/ChatMessage.tsx | Splits assistant message into thinking vs main content; renders thinking via new component. |
| src/hooks/useChatMessage.ts | Adds parsing logic to extract <think> blocks from assistant messages. |
| src/components/ThinkingMessage.tsx | New accordion UI to display “thinking” content. |
| src/components/ReasoningToggle.tsx | New icon-only toggle control for reasoning mode. |
| src/components/Icon.tsx | Adds arrow-up/lightbulb icons. |
| src/components/BooleanInput.tsx | Refactors BooleanInput to forward Switch props; adds wrapper class option. |
| src/components/tests/BooleanInput.test.tsx | Adds a controlled-mode sync test. |
| src/i18n/locales/en.json | Adds strings for reasoning + thinking/thought labels. |
| src/i18n/locales/zh-hans.json | Adds strings for reasoning + thinking/thought labels. |
| src/i18n/locales/zh-hant.json | Adds strings for reasoning + thinking/thought labels. |
| settings.default.json | Adds chat.reasoningEnabled default. |
| electron/AutoUpdateService.ts | Disables auto-download in dev to avoid bundle-id mismatch issues. |
You can also share your feedback on Copilot code review. Take the survey.
…n in request builders
7e3ae3f to
39df53c
Compare
…opup and SettingsChat
…ChatPopup to pass label
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 28 out of 30 changed files in this pull request and generated 6 comments.
You can also share your feedback on Copilot code review. Take the survey.
…losed thinking blocks
…g-to-content transitions in streaming
…ChatPopup and SettingsChat
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 29 out of 31 changed files in this pull request and generated 4 comments.
You can also share your feedback on Copilot code review. Take the survey.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 32 out of 34 changed files in this pull request and generated 2 comments.
You can also share your feedback on Copilot code review. Take the survey.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 32 out of 34 changed files in this pull request and generated 3 comments.
You can also share your feedback on Copilot code review. Take the survey.
Description
Support reasoning models
Type of Change
Checklist