feat: add reasoning_effort configuration support for Doubao/GPT-5 models#947
Open
zhiyunyao wants to merge 4 commits intobytedance:mainfrom
Open
feat: add reasoning_effort configuration support for Doubao/GPT-5 models#947zhiyunyao wants to merge 4 commits intobytedance:mainfrom
zhiyunyao wants to merge 4 commits intobytedance:mainfrom
Conversation
* Add `reasoning_effort` parameter to model config and agent initialization * Support reasoning effort levels (minimal/low/medium/high) for Doubao/GPT-5 models * Add UI controls in input box for reasoning effort selection * Update doubao-seed-1.8 example config with reasoning effort support Fixes & Cleanup: * Ensure UTF-8 encoding for file operations * Remove unused imports
Collaborator
|
@zhiyunyao, please fix the test error that was introduced by the change of reasoning effort. |
Contributor
There was a problem hiding this comment.
Pull request overview
Adds end-to-end “reasoning effort” capability metadata and UI controls so users can select reasoning depth for models that support it (e.g., Doubao/GPT-5-class models), and propagates that setting through agent initialization and model creation.
Changes:
- Extend model metadata (backend + frontend types +
/api/models) withsupports_reasoning_effort. - Add frontend reasoning-effort selector and pass
reasoning_effortvia thread context. - Wire backend agent/model factory to accept and forward
reasoning_effort, plus small config/encoding cleanup.
Reviewed changes
Copilot reviewed 18 out of 19 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| frontend/src/core/threads/types.ts | Adds reasoning_effort to thread context typing. |
| frontend/src/core/settings/local.ts | Persists reasoning_effort in local settings context. |
| frontend/src/core/models/types.ts | Adds supports_reasoning_effort to model metadata typing. |
| frontend/src/core/i18n/locales/zh-CN.ts | Adds zh-CN strings for reasoning effort UI. |
| frontend/src/core/i18n/locales/en-US.ts | Adds en-US strings for reasoning effort UI. |
| frontend/src/core/i18n/locales/types.ts | Extends translation type to include reasoning effort keys. |
| frontend/src/components/workspace/messages/message-list.tsx | Refactors MessageList to take messages explicitly. |
| frontend/src/components/workspace/input-box.tsx | Adds reasoning effort selector UI and mode-driven defaults. |
| frontend/src/app/workspace/chats/[thread_id]/page.tsx | Passes reasoning_effort through threadContext; updates MessageList usage. |
| config.example.yaml | Updates example model config to include Doubao + supports_reasoning_effort. |
| backend/src/reflection/resolvers.py | Removes unused TypeVar (keeps PEP 695 generics). |
| backend/src/models/factory.py | Attempts to inject/strip reasoning_effort and disable thinking via extra_body. |
| backend/src/gateway/routers/models.py | Exposes supports_reasoning_effort in model API responses. |
| backend/src/config/model_config.py | Adds supports_reasoning_effort to model config schema. |
| backend/src/config/extensions_config.py | Ensures UTF-8 when reading extensions config JSON. |
| backend/src/config/app_config.py | Ensures UTF-8 when reading YAML config. |
| backend/src/client.py | Includes supports_reasoning_effort in client model listings. |
| backend/src/agents/lead_agent/agent.py | Reads reasoning_effort from runnable config, logs it, passes to model factory. |
| .gitignore | Ignores .vscode/. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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.
Overview
This PR adds comprehensive support for reasoning effort configuration across the DeerFlow agent system, enabling models that support variable reasoning depths to expose this capability to users.
Key Changes
Backend
ModelConfigwithsupports_reasoning_effortflag to declare model capabilitycreate_chat_model()to passreasoning_effortparameter to LLM providers/api/modelsand/api/models/{model_name}to include reasoning effort capability in model metadataapp_config.py&extensions_config.py)resolvers.py)Frontend
reasoning_effortfieldConfiguration
supports_reasoning_effort: trueto enable the feature