Repository navigation
Replies: 3 comments 1 reply
GUI「新会话」静默 resume 旧空白草稿,使「设置只影响新建会话」的语义不可达观察环境:DSH 0.2.2-rc.1(Desktop/Web),Windows。 现象。开启「设置 → 子智能体 → 允许 Agent 为子智能体选择模型」(写入 根因(源码核实)。「新会话」并不创建会话:
因此,在开关启用之前创建的空白草稿每次被 resume 都是 为什么令人困惑。空白草稿的创建时间在界面上不可见,侧栏标签写的是「新会话」,没有任何地方 复现步骤。
建议修法(二选一)。
用户侧迂回。归档工作区内全部空白草稿,或换到没有空白草稿的位置触发全新 mint。 |
|
Your root cause analysis is correct on all four steps, and it's worth naming the consequence precisely: this isn't "settings are ignored", it's that a Session's route set is frozen at seed time and there is no UI path to a Session that has not been seeded. Confirming the chain, plus one detail that makes the fix sharper. You cite Three ways to fix it, and I'd argue for the third:
(3) also fixes the wider symptom class, not just this one: any future setting that's read at seed time has the same unreachability problem today. A workaround worth putting in the thread, since this will take a release to land: the settings are read at claim, so nudging the Session out of the "reusable blank" state should re-seed it. Concretely, sending one message and then using "New Session" gets a new seed — which is presumably why this doesn't affect people who use the GUI continuously. If you can confirm that, it's a useful diagnostic for whoever picks this up: it proves the state is the seed, not a cached settings value. One question about the repro that would strengthen the report: does it reproduce when the blank draft is empty versus when it has unsent text? |
|
Two things worth adding, both aimed at whether the fix is a one-liner or a redesign. On the repro question I asked: the answer changes the fix, so it's worth confirming before anyone writes code. If it reproduces with an empty draft, A cheaper workaround than archiving, worth putting in the report: the gate is If neither matches what you saw, that's itself a useful finding and the report should say so — it would mean the freeze happens earlier than |
Uh oh!
There was an error while loading. Please reload this page.
GUI "New Session" silently resumes an old blank draft, making "settings apply to new Sessions" unreachable
Observed on DSH 0.2.2-rc.1 (Desktop/Web), Windows.
Symptom. After enabling Settings → Subagents → allow Agents to choose a subagent model
(which writes
subagent-model-selection-settingsand is documented as affectingsubsequently created top-level Sessions), a user can click "New Session" repeatedly and never
obtain a Session that honors the new route list.
list_subagent_models(provider=…)keepsanswering with the parent route only, and explicit
provider/modelonsubagentis denied withLLM provider "…" is not allowed for this Session.Root cause (source-verified). "New Session" does not create a Session:
packages/client/ui-workspace/src/client/navigation.ts:234-250—createInWorkspace()findsthe workspace's first blank, unarchived Session and passes its
sessionIdto create(the interface comment at :84-91 states "New Session returns to that blank's unsent draft").
packages/api/session-controller/src/agent.ts:343-391—claim()treats a named Session withno
turn/startas reusable and callsagents.resume()rather than creating.packages/core/session/src/index.ts:804-809 (agent-loop)→Session.fromRestorereplays thestored log as
seed; the constructor appendssession/end-seed {}(:697-701) and freezesfirstLiveSeq = log.length(:669).packages/subagent/tool-subagent/src/model-selection-settings.ts:67-69— the policy is onlysampled when
firstLiveSeq === 0 && eventAt(0) !== 'session/end-seed'.So a blank draft created before the setting was enabled is resumed forever with
firstLiveSeq = 3(its three pinned permission events), never qualifying. Policy is by designwritten at creation only and never backfilled on resume — the 2026-08-24 note explicitly mentions
"including an explicitly empty restored Session" — so this is not a gate bug, but the UI makes
the documented semantics unreachable.
Why it is surprising. The blank draft's creation time is invisible in the UI, and the sidebar
label reads "New Session". Nothing indicates the click resumed a two-week-old draft. Users
reasonably conclude the setting is broken (it took several rounds of local diagnosis here,
including checking whether the branch/worktree mattered — it does not).
Reproduction.
list_subagent_models(provider="<allowed provider>").permission/preset,sandbox/mode,approval/policywith the draft's original timestamp, seq 3 issession/end-seedwith{},and no
subagent/model-selection-policyexists.firstLiveSeq === 0and receives the policy event. (Verified working workaround.)Suggested fixes (either).
current settings (treat "restored but never used" as a creation).
settings revision, or surface in the UI that the click resumed an existing draft.
Workaround for users who cannot upgrade. Archive all blank drafts in the workspace, or
force a new mint by starting where no blank exists. Existing Sessions without a policy cannot be
repaired client-side;
agent.model.select(e.g. via a teammate-model helper) is unaffected by thegate and is the only route-level workaround for them.
All reactions