A failed Session creation is silent: the Web client shows an empty panel while only the browser console explains why #6699
luckystation-cmd
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Summary
When a new Session cannot be created — most reachably, because
settings.yamlkeeps anagent-presets.defaultthat the running build no longer ships — the Web client shows an empty panel reading "Choose a workspace to start" with no explanation. The reason exists only as aconsole.warnin the browser DevTools. Nothing in the Host log, nothing in the UI.The Host behavior is deliberate and pinned by a test. The reporting gap is not.
Reproduction
standard, ptc, minimal, cordis.<dsh-home>/settings.yamlcarries a default left by an earlier build:dsh web, authenticate, open the GUI.Observed: the workspace region lists workspaces, the hero renders, and the composer never appears — the placeholder stays on "Choose a workspace to start". The only evidence is:
dsh-server.log.erris empty, and the initial-selection reconcile sets itself back towaitingand retries on the next snapshot change, so the condition never resolves and nothing is ever shown.Root cause
Host (deliberate).
AgentPresets.resolverefuses an id no configured root supplies —packages/preset/agent-presets/src/index.ts:365. The effective default is the settings-saved value whenever mode selection is on (defaultId/selectionPolicy,packages/preset/agent-presets/src/index.ts:243and:251), so an upgrade that drops a preset id leaves the setting dangling and every unnamed Session creation fails.packages/preset/agent-presets/tests/settings.spec.ts:165("reports an unknown user default only when a session tries to use it") pins this on purpose: the roster is a live directory, so a name absent now may exist by the time a Session asks for it.Client (the defect).
UiWorkspaceService.connectWorkspace—packages/client/ui-workspace/src/client/navigation.ts:144— is the only place a Session creation runs, and both of its callers reduce a rejection to a console line:packages/client/ui-workspace/src/client/navigation.ts:241—new session failed:packages/client/ui-workspace/src/client/navigation.ts:297—initial workspace selection failed:Every other error surface in the client is Session-scoped (the composer announces
promptErrorand machine notices as a toast). A failure that happens before any Session exists therefore has no surface that can carry it, which is why the console was the only witness.Why the obvious host fix is wrong
Making
resolve(undefined)fall back toconfig.defaultwhen the saved id is missing would silently substitute a composition the operator did not choose, contradict the contract pinned atsettings.spec.ts:165, and be exactly the "silently skip a missing referent" the repository forbids. The defect to fix is the reporting, not the refusal.Proposal
Announce the failure where the operator is looking, from the one New-Session surface that is mounted whether or not a Session is open. A fix that works on a local checkout:
UiWorkspaceServicepublishes its connect outcome as a snapshot source,navigationFailure: HostObservable<{ revision: number; message: string | undefined }>.connectWorkspacereports on the rejection arm and withdraws on the success arm, including the blank-Session reuse path, so a completed connect never leaves an announcement for a surface that mounts later.revisionincrements per publish so an identical repeated failure announces again instead of being swallowed as an unchanged snapshot.WorkspaceBrowser(thesidebar.workspacesoccupant) binds it through the injecthookscompartment asuseNavigationFailureand renders the primitiveToastwith a newnavigation.failuredictionary key, keyed byrevision. The Host'sErrormessage travels untranslated, matching the policypackages/client/ui-workspace/src/client/locales.tsalready states for runtime failure strings.console.warncalls stay for developer diagnostics.The browsing region is chosen over the hero picker because
conversation.hero.workspaceis mounted only while no Session is open, so a New Session that fails from an open Session would stay silent; a single surface also avoids two identical banners when both are mounted (which is exactly the empty state that reproduces the report).Acceptance criteria
role="alert"), localized through thenavigation.failurekey with the wire message passed through.navigationFailureon the browsing region; the source's snapshot object is stable between changes.Errorrejection / disposer, and the rendered copy plus its retirement.Workaround for affected users
Point
agent-presets.defaultin<dsh-home>/settings.yamlat a preset the build ships (for the build above:standard), or setmodeSelectionEnabled: falseso the deployment default applies. Delete the key to fall back toconfig.default.Related
A durable remedy for the upgrade case — validating or clearing a settings-saved default that no configured root supplies — belongs to
agent-presetsand is deliberately out of scope here; this issue is about the dead-end being silent.All reactions