zai-org / zai-org/feedback

[Bug] 会话 resume 首响应返回会话旧模型,覆盖用户手动切换的供应商(modelHint 与 runtimeModel 均指向新选择仍被压制,第二次 resume 才生效)

Open
#421 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

priority: P2 status: 待评估 type: Bug
Dominant language
No language data
Stars
22
Forks
1
PR merge metrics
No merged PRs in 30d

Description

提交前确认 · Pre-submission checklist
  • 我已搜索过现有 issue,确认这不是重复 / I searched existing issues and confirmed this isn't a duplicate.
  • 我已阅读 CONTRIBUTING.md / I've read CONTRIBUTING.md.
问题类别 · Category

模型设置 / 切换 · Model config

涉及的 Agent 框架 · Agent framework

ZCode Agent(自研)

严重程度 · Severity

影响体验 · Major (功能可用但体验受损 / works but degraded)

复现频率 · Reproducibility

必现 · Always

问题描述 · Description

多供应商环境下(官方 Coding Plan(OAuth)+ openai-compatible 自定义供应商),用户在会话中手动切换模型供应商后发送消息,第一次 session/resume响应返回该会话此前固化的旧供应商(modelCurrent=旧),尽管请求体内 modelHintruntimeModel 两个字段都已指向用户新选的供应商。用户可见效果为「手动切换被自动切回」。约 0.3–1.4 秒后由 sendPrompt 流程触发的第二次 resume 才返回新供应商。全局供应商家族选择(setting.json 的 modelProviderFamilySelectedKeys)与会话实际运行模型可长期分叉。

复现步骤 · Steps to reproduce
  1. 用供应商 A(如自定义 openai-compatible 池)正常使用一个会话若干回合(会话服务端固化 A);
  2. 在模型选择器手动切换到供应商 B(官方 Coding Plan),确认 UI 已显示 B;
  3. 在该会话发送一条消息(触发 session/resume);
  4. 观察状态栏模型与日志(~/.zcode/v2/logs/)。
期望表现 · Expected behavior

resume 沿用用户当前选择(请求中的 modelHint / runtimeModel),首次响应即返回 B。

实际表现 · Actual behavior

首次 resume 响应 modelCurrent=A(会话持久旧模型),UI 随之显示 A——表现为「切换被切回」;仅约 0.3–1.4 秒后第二次 resume(sendPrompt 触发)才返回 B。当日 8/8 次复现同一形态(16:21 / 19:05 / 20:01 / 21:21 / 21:41 / 22:01 / 22:21 / 22:41)。

ZCode 版本 · ZCode version

v3.10.1.6272

设备 / 系统 / 浏览器 · Device / OS / Browser

Windows 10 x64 (10.0.26100) / ZCode 桌面客户端 / 多供应商:官方 Coding Plan(OAuth)+ openai-compatible 自定义供应商 ×2

截图 / 录屏 / 日志 · Screenshots / Recordings / Logs

日志铁证(以 21:41:24 窗口为例,~/.zcode/v2/logs/2026-08-29.log L20218–L20224):

L20218 21:41:24.578 resume 开始:
  modelHint={"providerId":"builtin:bigmodel-coding-plan","modelId":"GLM-5.3"}
  runtimeModel.model="builtin:bigmodel-coding-plan/GLM-5.3"   ← 两字段一致=B
L20219 21:41:26.273 resume 完成:
  modelCurrent="d236f9de-2bfa-.../GLM-5.3"                    ← 响应=A(旧)
L20220 21:41:26.603 第二次 resume 开始:modelHint=null, runtimeModel=B
L20223 21:41:27.752 第二次完成:modelCurrent=B               ← 此时才生效

对照统计(当日 226 对 resume 逐条配对):hint=null 且带 runtimeModel 的 171/171 次响应完全跟随请求(稳态正常);hint=obj 且响应≠hint 的 8/8 次全部异常返回会话旧池——异常 100% 关联「切换后首次 resume」。

分叉现场:22:11:17 起 setting.json modelProviderFamilySelectedKeys.bigmodel=自定义池 d236f9de,但该会话至截稿仍反复运行在 builtin——两层状态持续分叉。

已排除配额自动降级说:异常返回的旧池包括已 429 超额的池(同秒内从健康池翻回超额池,日志形态不支持降级)。

与现有 issue 的区分:#391 是启动时 OAuth entitlement 覆写 setting.json,本 issue 是 resume 响应用会话持久模型压制请求内显式选择——机制不同;#339 同属「运行时会话模型状态与用户选择脱节」问题域;#199 亦可见 resume 透传 runtimeModel。v3.6.5 / v3.7.5 修过相邻问题,3.10.1 仍复现。

另想请教:全局 family 选择与 per-会话 modelHint 两层的预期同步语义是什么?

复算命令

L=~/.zcode/v2/logs/<日期>.log
grep -c -F '开始请求 ZCode Protocol session/resume' "$L"
grep -c -F '"modelHint":{' "$L"
# 配对 resume 开始/完成行,比对 modelHint.providerId vs 响应 modelCurrent

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the session/resume and sendPrompt request flow, using the referenced log at ~/.zcode/v2/logs/2026-08-29.log and setting.json to compare modelHint, runtimeModel, and modelCurrent. Trace why the first response prefers the persisted session model, then verify that an explicit provider selection is reflected in the first resume response without breaking the stable hint=null path.

Written by the indexing model from the issue text.

Assessment

Domain
api, desktop
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.