Skip to content

Feature/reasoning support#25

Merged
Louis-7 merged 18 commits intomainfrom
feature/reasoning-support-2
Mar 12, 2026
Merged

Feature/reasoning support#25
Louis-7 merged 18 commits intomainfrom
feature/reasoning-support-2

Conversation

@Louis-7
Copy link
Contributor

@Louis-7 Louis-7 commented Mar 12, 2026

Description

Support reasoning models

Type of Change

  • Bug fix
  • New feature
  • Documentation update
  • Refactor
  • Other

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

Louis-7 added 6 commits March 12, 2026 18:23
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.
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 reasoningEnabled chat setting and plumbs a reasoning flag 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.

@Louis-7 Louis-7 force-pushed the feature/reasoning-support-2 branch from 7e3ae3f to 39df53c Compare March 12, 2026 12:11
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@Louis-7 Louis-7 merged commit 699d587 into main Mar 12, 2026
8 checks passed
@Louis-7 Louis-7 deleted the feature/reasoning-support-2 branch March 12, 2026 13:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants