You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if(boundary!==undefined&&(boundary.openTurnStartSeq!==null||boundary.lastTurn>0)){thrownewRemoteError('agent-preset/locked',`session "${agent.id}" has already started; its agent preset is fixed`)}
其一,已开始过对话的会话预设被锁定,而本 issue 中的会话都有历史记录;其二,执行切换的 swap() 需要一个 live agent,而拿到 live agent 的前提是 resume 成功 —— resume 失败正是待修的问题本身,构成循环依赖。
Activity
zp-home commentedon Sep 17, 2026
补一份根因定位,说明这个问题为什么没有随 #998 一起修好,以及后续怎么走。
根因
报错来自 resume 路径。
deepseek-harness/packages/api/session-controller/src/agent.ts在重建会话时读取会话自己记录的 preset:而 preset id 的来源是会话创建头,见
packages/preset/agent-presets/src/session.ts:旧版本创建的会话,其创建头里写的是
code;新 runtime 的预设表只有standard / ptc / minimal / cordis,于是presets.resolve('code')抛出agent-preset/not-found,外层包成resume failed for session "..."。为什么不能照 #998 的方式修
#998(已合并)修的是
~/.dsh/settings.yaml里的全局默认值agent-presets.default: code,解决的是新建会话失败(#997)。它动不了已存在会话里的 preset id,因为两者存放位置完全不同:创建头按设计不可改。 同一文件的模块注释写明创建头 "is deep-frozen because that is a creation fact"。
唯一被允许的改法是追加
agent-preset/selected事件,但对本场景双重不可行。packages/preset/agent-presets/src/index.ts中:其一,已开始过对话的会话预设被锁定,而本 issue 中的会话都有历史记录;其二,执行切换的
swap()需要一个 live agent,而拿到 live agent 的前提是 resume 成功 —— resume 失败正是待修的问题本身,构成循环依赖。上游也没有相应的存储迁移。
session-format-v0-to-v1的dispositions.ts对agent-preset/selected只做 payload 成员保留,没有值映射;v1-to-v2、v2-to-v3同样没有。整个 harness 源码中不存在code→ptc的会话迁移。现状与后续
code别名的 fix(stable): restore legacy code preset compatibility #874 已关闭:该方案已由cac07349主动废弃(详见该 PR 中的说明)。deepseek-harness:要么在预设解析层重新提供历史 id 的兼容,要么增加一条会话格式迁移边。当前可用的绕过办法:受影响的历史会话暂时无法恢复;新建会话请先按 #997 中的方法把
~/.dsh/settings.yaml的agent-presets.default改为ptc(升级到含 #998 的版本后会自动完成)。