refactor(ai): unify reasoning config and modularize client pipeline#393
Merged
wsp1911 merged 3 commits intoGCWing:mainfrom Apr 12, 2026
Merged
refactor(ai): unify reasoning config and modularize client pipeline#393wsp1911 merged 3 commits intoGCWing:mainfrom
wsp1911 merged 3 commits intoGCWing:mainfrom
Conversation
…easoning replay - remove preserved_thinking config and related UI/installer wiring - stop trimming historical reasoning_content before model requests - separate request token estimation from send-path replay behavior - count reasoning tokens only for the latest live turn during local estimation - document OpenAI chat/completions reasoning replay compatibility behavior - clean up obsolete preserved thinking locale strings and add coverage tests
- replace legacy thinking flag with reasoning mode and keep backward-compatible config migration - normalize provider-specific reasoning payloads for OpenAI-compatible, Anthropic, and Gemini models - expose reasoning mode, effort, and thinking budget controls in model config UI and schema
- split the AI client into shared transport utilities and provider-specific request/discovery modules - add custom_request_body_mode config flow with merge/trim support across OpenAI, Anthropic, and Gemini - refresh AI model settings UI with mode toggles, inline warnings, tooltips, and i18n copy updates - remove unused model penalty fields and keep related config handling aligned
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.
Summary
This PR refactors the AI request pipeline and unifies reasoning configuration across providers.
It consolidates the recent reasoning-related changes into a consistent config model, removes obsolete preserved-thinking behavior, and restructures the AI client into smaller provider-specific/request-specific modules. It also updates the model configuration UI and related schema/i18n to match the new behavior.
Changes
custom_request_body_modewith merge/trim supportWhy
Previously, reasoning/thinking behavior was split across multiple config shapes and provider-specific paths, which made the request pipeline harder to maintain and the UI harder to understand.
This PR moves the system toward:
Impact
Backend
Frontend