fix(reasoning): 推理强度补齐 max 档,与 hermes_constants 对齐
WebUI 镜像的 VALID_REASONING_EFFORTS 此前止于 xhigh,漏了底层 hermes_constants 已有的 max 档。补齐后端常量、前端命令/下拉/帮助文本, 并同步快照测试。支持 max thinking 的 provider(如 Anthropic)现可在 composer 下拉和 /reasoning 命令中选到 Max。
This commit is contained in:
1 parent
20f8c7c02d
commit
b554fd8078
5 files changed
+10
-5
No files matched your search
@@ -3,6 +3,10 @@
|
||||
|
||||
## [Unreleased]
|
||||
|
||||
### Added
|
||||
|
||||
- The reasoning-effort selector now offers a `max` level, matching the agent's `hermes_constants.VALID_REASONING_EFFORTS`. This restores parity with the underlying set (the WebUI mirror previously stopped at `xhigh`) so providers such as Anthropic that support the `max` thinking level are selectable from the composer dropdown and the `/reasoning` command.
|
||||
|
||||
## [v0.51.155] — 2026-05-28 — Release EA (stage-batch37 — 3-PR very low-risk cleanup: passive timeout toasts + sidecar order + subsecond timestamps)
|
||||
|
||||
### Fixed
|
||||
|
||||
+1
-1
@@ -2073,7 +2073,7 @@ def get_effective_default_model(config_data: dict | None = None) -> str:
|
||||
# Mirrors hermes_constants.parse_reasoning_effort so WebUI can validate without
|
||||
# importing from the agent tree (which may not be installed). Any drift here
|
||||
# will show up in the shared test suite since both sides accept the same set.
|
||||
VALID_REASONING_EFFORTS = ("minimal", "low", "medium", "high", "xhigh")
|
||||
VALID_REASONING_EFFORTS = ("minimal", "low", "medium", "high", "xhigh", "max")
|
||||
|
||||
|
||||
def parse_reasoning_effort(effort):
|
||||
|
||||
+3
-3
@@ -29,7 +29,7 @@ const COMMANDS=[
|
||||
{name:'background',desc:t('cmd_background'),fn:cmdBackground,arg:'prompt', noEcho:true},
|
||||
{name:'status', desc:t('cmd_status'), fn:cmdStatus},
|
||||
{name:'voice', desc:t('cmd_voice'), fn:cmdVoice, noEcho:true},
|
||||
{name:'reasoning', desc:t('cmd_reasoning'), fn:cmdReasoning, arg:'show|hide|none|minimal|low|medium|high|xhigh', subArgs:['show','hide','none','minimal','low','medium','high','xhigh'], noEcho:true},
|
||||
{name:'reasoning', desc:t('cmd_reasoning'), fn:cmdReasoning, arg:'show|hide|none|minimal|low|medium|high|xhigh|max', subArgs:['show','hide','none','minimal','low','medium','high','xhigh','max'], noEcho:true},
|
||||
{name:'yolo', desc:t('cmd_yolo'), fn:cmdYolo, noEcho:true},
|
||||
{name:'branch', desc:t('cmd_branch'), fn:cmdBranch, arg:'[name]', noEcho:true},
|
||||
];
|
||||
@@ -1131,13 +1131,13 @@ function cmdReasoning(args){
|
||||
const arg=(args||'').trim().toLowerCase();
|
||||
const BRAIN='\uD83E\uDDE0';
|
||||
// Matches hermes_constants.VALID_REASONING_EFFORTS + 'none' (CLI parity).
|
||||
const EFFORTS=['none','minimal','low','medium','high','xhigh'];
|
||||
const EFFORTS=['none','minimal','low','medium','high','xhigh','max'];
|
||||
// Shared status renderer used by the no-args branch and as a fallback.
|
||||
function _fmtStatus(st){
|
||||
const vis=(st && st.show_reasoning===false)?'off':'on';
|
||||
const eff=(st && st.reasoning_effort)||'default';
|
||||
return BRAIN+' Reasoning effort: '+eff+' \u00B7 display: '+vis
|
||||
+' | /reasoning show|hide|none|minimal|low|medium|high|xhigh';
|
||||
+' | /reasoning show|hide|none|minimal|low|medium|high|xhigh|max';
|
||||
}
|
||||
if(!arg){
|
||||
// Status — read from the same config.yaml keys the CLI uses.
|
||||
|
||||
@@ -715,6 +715,7 @@
|
||||
<div class="reasoning-option" data-effort="medium">Medium</div>
|
||||
<div class="reasoning-option" data-effort="high">High</div>
|
||||
<div class="reasoning-option" data-effort="xhigh">Extra High</div>
|
||||
<div class="reasoning-option" data-effort="max">Max</div>
|
||||
</div>
|
||||
<div class="composer-toolsets-dropdown" id="composerToolsetsDropdown">
|
||||
<div class="toolsets-dropdown-desc" id="toolsetsDropdownDesc"></div>
|
||||
|
||||
@@ -297,7 +297,7 @@ class TestReasoningConfigHelpers:
|
||||
# Snapshot-style assertion: if hermes_constants adds a level, this
|
||||
# test will fail fast so we know to update WebUI too.
|
||||
assert VALID_REASONING_EFFORTS == (
|
||||
'minimal', 'low', 'medium', 'high', 'xhigh'
|
||||
'minimal', 'low', 'medium', 'high', 'xhigh', 'max'
|
||||
)
|
||||
|
||||
def test_set_reasoning_effort_persists_to_config_yaml(self, tmp_path, monkeypatch):
|
||||
|
||||
Reference in new issue
Block a user