[Bug] 3.10.2 会话分叉后思考强度选择器默认显示「低」:实际请求仍为 max,UI 兜底落到 variants[0] 而非 defaultVariant
Nobody has claimed this yet.
- Dominant language
- No language data
- Stars
- 22
- Forks
- 1
- PR merge metrics
- No merged PRs in 30d
Description
环境
- ZCode Desktop 3.10.2(3.10.2.6414,buildCommitId
35824adf,buildTime 2026-08-31),macOS Apple Silicon(darwin 25.6.0) - 供应商:BigModel Coding Plan;模型 GLM-5.3-Flash(模型目录 variants 顺序为
["low","max","high"],defaultVariantmax) - 用户全局推理强度设置(local_setting
namespace=model, key=reasoningLevel):{"level":"max"}
现象
对任意会话执行「分叉」后,新会话输入框旁的思考强度选择器默认显示为最低档「低」。经本地数据核验,实际发出的请求并未降级(仍是 effort max),判定为选择器显示/状态回填问题。但它会误导用户以为分叉后思考被降档,每次都得手动重选一遍。
复现步骤
- 使用 GLM-5.3-Flash,思考强度选 max;
- 打开一个思考强度为 max 的会话,对历史消息执行「分叉」;
- 观察新会话的思考强度选择器 → 显示「低」。
多次分叉(不同父会话)均复现。
期望行为
- 选择器显示并沿用父会话的有效档位(max);或至少
- 兜底落到模型目录的
defaultVariant,而不是variants[0]。
本地核验证据
- 会话库
db.sqlite的session_entry(type='runtime/model_selection'):每个分叉会话在创建的同一毫秒就写入了{"modelId":"GLM-5.3-Flash","thoughtLevel":"max"}—— 说明分叉路径在初始化时解析到的就是 max; rollout/model-io-sess_*.jsonl请求日志:分叉会话、父会话、子代理的实际请求均为"effort":"max"且thinking.budget_tokens=32000,没有低档请求;- 但该分叉会话 UI 上的思考强度选择器显示「低」。
逆向定位线索(基于 3.10.2 随包 zcode.cjs 与 host chunk,仅供参考)
- 选择器取值链为
thoughtLevel.current ?? defaultLevel ?? available[0](zcodeSessionSettingsToZCodeConfigOptions)。分叉会话的状态快照一旦没带上显式current/defaultLevel,就会落到available[0]; - GLM-5.3-Flash 的 variants 数组顺序恰好是
["low","max","high"],所以available[0]= 最低档「低」; - CLI 侧模型默认档解析:
defaultLevel && levels.includes(defaultLevel) ? defaultLevel : levels[0]; - 分叉注册路径
registerForkedSession:s && c.app.getThoughtLevel() !== s && setThoughtLevel(s)—— 仅当父会话能解析出显式档位时才复制。而getThoughtLevel()在多档位模型 + providerOptions 不匹配任一档位预设时会返回undefined(多档位时levels.length===1 ? levels[0] : undefined分支),疑似就是"拿不到显式值 → 状态里没有 current → UI 落到第一项"的来源。
修复建议
- 选择器兜底顺序改为
current ?? defaultVariant/defaultLevel ?? available[0]; - 分叉时始终把父会话的有效档位写入子会话状态,保证
thoughtLevel.current有值,而不是依赖解析链兜底。
相关 issue:#420(自动化任务编辑页"推理强度"回显错误——同为"存储高档位、界面显示低",疑似同一处兜底逻辑,可一并修)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by inspecting the zcode.cjs and host chunk paths named in the report, especially zCodeSessionSettingsToZCodeConfigOptions and registerForkedSession. Reproduce a fork with GLM-5.3-Flash and compare the stored session_entry thoughtLevel with the selector state. Done means the forked selector shows the effective parent level or defaultVariant instead of variants[0], without changing the request effort.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- macos
- Domain
- desktop
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100