fix: make reasoning effort opt-in, disable by default#345
Merged
icebear0828 merged 3 commits intomasterfrom Apr 10, 2026
Merged
fix: make reasoning effort opt-in, disable by default#345icebear0828 merged 3 commits intomasterfrom
icebear0828 merged 3 commits intomasterfrom
Conversation
Previously every request sent reasoning: { effort: "medium" } to the
Codex API due to modelInfo.defaultReasoningEffort always falling back to
"medium", causing 100K+ token consumption for simple conversations.
- Remove modelInfo?.defaultReasoningEffort from fallback chain in all
translation files (openai/anthropic/gemini) and responses.ts
- Change default_reasoning_effort schema default from "medium" to null
- Update config/default.yaml to default_reasoning_effort: null
- Allow null in settings API validation and hook type
- Add "Disabled (no reasoning)" option to Dashboard dropdown
- Update tests to reflect new opt-in behavior
Reasoning is still activated when: client sends reasoning_effort,
model name suffix specifies effort, or user sets default in config.
Previously reasoning: { summary: "auto" } was sent on every request even
without an effort, which caused include: ["reasoning.encrypted_content"]
to be added unconditionally. This could trigger default-effort reasoning
on models that interpret the presence of the reasoning object as opt-in.
Now reasoning is omitted entirely when no effort is configured or
requested. The responses.ts route preserves client-supplied reasoning
objects (e.g. explicit summary override) when present.
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
reasoning: { effort: "medium" },即使是最简单的 "hi" 也会触发 medium 推理,导致用户一次对话消耗 0.1M+ tokens(相关 issue: 代理可能导致输入token消耗激增,一次简单对话竟然要0.1m token #344)modelInfo?.defaultReasoningEffort从兜底链(三个翻译文件 +responses.ts),彻底切断模型元数据自动激活推理的路径default_reasoning_effortschema 默认值改为null,config/default.yaml同步更新null,Dashboard 新增 "Disabled (no reasoning)" 选项Reasoning 仍在以下情况生效:客户端显式传
reasoning_effort、模型名后缀指定、或用户在 Dashboard 手动设置。Test plan
npm test— 1331 tests passeddoes not set reasoning effort when config is null and no explicit requestaccepts null default_reasoning_effort to disable reasoningFixes #344