Bug report: New Session silently fails when the default agent preset no longer exists #1839
Replies: 4 comments
|
Related report: #4115 — a generalized version of this failure mode. When any active/in-use agent preset fails to mount (e.g. a broken custom preset created via create-mode), every New Session click from an existing session silently fails with zero UI feedback ( |
|
Confirmed on DSH Desktop 2.0.3 / Windows 11. This was the same stale-default condition described here, including the misleading fallback display. I reproduced it with a newly created The shared agent-presets:
default: minimal-windows
An important UI detail: selecting Standard mode again did not repair the setting because the UI already considered Standard selected; the YAML value remained agent-presets:
default: standardImmediately afterward, without restarting Desktop, the global New Session button worked: a new This also explains why the problem persisted in a plugin-free profile: the agent-preset default is shared across profiles, while the preset that originally supplied No diagnostic archive is attached because it contains local paths and session/workspace identifiers. I can provide sanitized excerpts if useful. |
Addendum: still 100% reproducible on 0.1.5-rc.1 (the settings-default path)
That is exactly what I hit:
Nothing happens in the UI. The console shows: Three details that may help triage1. It is not workspace-related. I verified it in a freshly added workspace and in an existing workspace that already has several sessions — identical behaviour. The failure happens inside 2. Nothing is visible at the HTTP layer. 3. The stale value can be a pure orphan. I checked the persisted session headers on this machine (first line of each So A note on where the gap ends (would like your view)In 0.1.5-rc.1 I can see that // :687 session header
...header.agentPreset === "code" ? { agentPreset: "ptc" } : {}
// :819 agent-preset/selected event
case "agent-preset/selected": return event.data["agentPreset"] === "code" ? { ... } : ...So on the current release the session-data side appears to be covered. The configuration side still has no migration at all — I scanned the installed packages: I am not sure whether that v2→v3 mapping covers every historical format path — for example a session that is already at v3, or one that came up through v0/v1 step by step. If you have a moment, I would be curious to know: if the coverage is incomplete, the resume failures in #4829 might come from those edge paths, whereas what I hit is purely the configuration-side gap and is unaffected by that mapping either way. Workaround confirmedSetting Thanks again for the diagnosis and the patch! |
|
Independent confirmation on 0.1.5-rc.1 (Windows 11, npm global, Symptom: every New Session path was dead — the global button, the per-workspace click, and the startup initial-workspace selection. Console showed only:
Where this case differs from the existing reports: the stale value was neither hand-edited nor a deleted custom preset.
Consequence: this is not an exotic state. Anyone who selected Code mode in the picker before 2026-08-27 and then upgraded has every new session refused, while Settings still shows a valid mode (the picker falls back to the first roster entry), and Suggested minimal fix, reusing what the repository already does for sessions: apply the same |
Uh oh!
There was an error while loading. Please reload this page.
Summary
When the configured default agent preset no longer exists, every "New Session" action in the Web UI fails silently: clicking "+" on any workspace (or the global New Session button) shows nothing at all. The only trace is
new session failed: … agent-preset-not-found …in the browser console.This bricked session creation for every workspace until the stale setting was repaired manually.
Environment
0.1.0-rc.6(installed globally from npm), Node 24, Web profile (dsh web), Chromium, zh-CN UI~/.dsh/settings.yamlcontainedagent-presets.default: anchored-standardwhile the preset roster only suppliedstandard, code, minimal, cordis, router-standardSteps to reproduce
dsh weband open the UI.foo).~/.dsh/.agent-presets/, or uninstall the plugin that supplied it.Expected
A New Session row appears under the workspace, or at least a visible error explaining the refusal.
Actual
Nothing happens in the UI. The click looks dead. Console shows:
Every new-session path is affected the same way: the per-workspace "+" button, the global New Session button, and the startup initial-workspace selection.
Root cause
AgentPresets.defaultIdresolves to the stale settings value, andresolve()deliberately throwsUnknownPresetErrorwhen the roster lacks it (the "default may name a preset authored later" design). So the Host correctly refusessession.create.WorkspaceRuntime.startSession(packages/client/runtime/src/client/workspaces/service.ts) catches that refusal with onlyconsole.warn('new session failed:', …)— no observable state, no UI surface. That is what makes the click look dead.agentPreset.listmarks no preset as default in this state, so the settings row and the new-session chip fall back to displaying the first roster preset (standard), while the Host still resolves the stale default and refuses. The UI shows "standard" but creates nothing.Notes on the trigger
The stale default arose by deleting a preset outside the managed flow (from the command line; the preset originally came from a GitHub-installed plugin). That is an expected, real-world state —
AgentPresets.remove()already clears a user default on managed delete, and the code comments explicitly anticipate presets being "deleted from disk outsideremove". So the framework anticipates this state but then fails invisibly.Suggested fix (already implemented in a local checkout, happy to PR)
newSessionErroronWorkspaceListStateindsh-client-runtime), cleared by the next attempt or an explicit dismiss.dsh-client-ui-workspace), so a refused click is never silent.agentPreset.listshould flag "default names a missing preset" so the settings UI can warn instead of pretending the first roster entry is the default.Workaround
Clear or re-pick
agent-presets.defaultin Settings → Agent presets (or edit~/.dsh/settings.yaml).All reactions