Replies: 2 comments
|
Independently verified the two load-bearing facts against current master, both hold up exactly. Commit 3ca9c7d "rename code-mode to ptc (PTC mode), except session-persistent vocabulary" is real and in the history. The current resolve() in packages/preset/agent-presets/src/index.ts matches your diff's context lines exactly, line for line: const wanted = id ?? this.defaultId, const presets = await this.list(), const found = presets.find(preset => preset.id === wanted), and the same RemoteError throw shape. Your patch would apply cleanly against master as it stands right now. I also grepped for LEGACY_PRESET_IDS across the whole tree and got zero hits, so this hasn't been fixed yet. Nice catch that the migration codecs copy agentPreset verbatim rather than translating it, that's the part that makes this a genuine gap rather than something format migration already covers. The successor-lookup-after-roots ordering in your patch also correctly preserves the case where a user root still ships an alias under the old name, which is a detail that would have been easy to get backwards. This looks ready to go as-is. Given CONTRIBUTING.md doesn't take external PRs, hopefully a maintainer picks this up directly, since you've already done the verification work for them. |
|
I reproduced a related variant on Windows with The affected workspace contained a persisted blank session (0 turns) whose projection metadata had When selecting/creating the blank session in the affected workspace, the sidebar selected
So in addition to aliasing As a local workaround, after backing up storage, removing the empty malformed session record from the affected workspace index caused Harness to create a fresh blank session with |
Uh oh!
There was an error while loading. Please reload this page.
Sessions created before 0.1.2 under the shipped
codepreset fail to resume after the rename toptc.复现、预期与验收 / Repro, expected, acceptance
codepreset (the default at the time). Optionally setagent-presets.default: codeinsettings.yaml.master).default: codeis still stored.codeis affected; so is any deployment whose settings still namecodeas the default.A session logged under the old preset id resumes on the renamed shipped preset, as the release note promised ("Rename Code Mode to PTC mode while keeping existing conversation records readable").
@deepseek-ai/dsh0.1.2-rc.1 (community containerrunzhliu/deepseek-harness:0.1.2-rc.1-r1), Node 24, Linux. Code path is unchanged onmaster@ d347e70.agentPresets.resolve('code')andresolve()withdefault: codereturn theptcpreset when a root suppliesptc; a root that still suppliescodewins; unknown ids still raiseagent-preset/not-found; the roster never listscode.原因 / Root cause
Commit 3ca9c7d "rename code-mode to ptc (PTC mode), except session-persistent vocabulary" renamed
presets/code→presets/ptc. The session-persistent vocabulary it deliberately kept coverstool/code-dispatch*events, the logged plugin name and the sub-call id segment — but not theagentPresetvalue in the session header (and inagent-preset/selectedevents).AgentPresets.resolve()(packages/preset/agent-presets/src/index.ts) looks an id up across the configured roots and throws when none supplies it; there is no alias for a retired id. Thesession-format-v0-to-v1/v1-to-v2codecs copyagentPresetverbatim, so a format migration does not repair it either.修复建议 / Proposed fix
A small map from retired ids to successors, consulted in
resolve()after the roots (so a root that still ships the old id keeps winning), with tests. Verified locally onmaster:vitest run packages/preset/agent-presets192/192,tsc -bclean, oxlint clean, per-file coverage ofpackages/preset/agent-presets/srcstays 100%.Patch (also usable with
git am): see attachment / below.用户侧临时方案 / Workaround for users
Without changing the code: put an alias into the user preset root
$DSH_HOME/.agent-presets/code/— a byte-for-byte copy of the shippedpresets/ptc/agent.cordis.ymlplus apreset.yml(name: code (legacy → PTC)) — and setagent-presets.default: ptcinsettings.yaml. Discovery re-reads roots on every call, so no restart is needed for the alias. Keep the copy in sync withptcon each upgrade.All reactions