Repository navigation
Description
What happened?
After upgrading ds-bot 0.3.10 → 0.4.0 the plugin page shows
ds-bot: Error: cannot get property "uiSession.sessionStatus" without inject
and the bot surface never mounts — the host wraps it as
Bot mode could not be set up here: cannot get property "uiSession.sessionStatus" without inject.
Cause (confirmed in the published 0.4.0 package)
src/client/index.js:91 declares six services:
export const inject = ['sessions', 'uiWorkspace', 'uiConversation', 'slots', 'theme', 'layout']Two ctx.effect bodies read uiSession.sessionStatus eagerly — i.e. while the surface is being installed, not later on a user action:
src/client/index.js:1281—'ds-bot: rescue interrupted question drafts'src/client/index.js:1772—'ds-bot: sidebar completions'
const sessionStatus = ctx.get('uiSession')?.sessionStatusuiSession.sessionStatus is its own namespace service (the host documents the
uiSession.sessionStatus service as being read as ctx.uiSession.sessionStatus);
the uiSession object itself carries no such property. Cordis validates a nested
service property read against the plugin's inject list using the dotted name,
so the read throws, both effects fail, and the whole surface aborts.
?. does not guard this: the throw comes from the service getter, not from a null
object — the same mechanics as #2055, on a different service.
Why this is a missed declaration, not a host change
- 0.3.10's client bundle never mentions
uiSession(0 occurrences), so this read
arrived with 0.4.0. - Both services exist in the current host build: four bundled official plugins list
them in their owninject, and two of those list only the dotted
uiSession.sessionStatus— so the service is provided and is declarable alone.
Suggested fix
export const inject = ['sessions', 'uiWorkspace', 'uiConversation', 'slots', 'theme', 'layout', 'uiSession', 'uiSession.sessionStatus']The rebuilt client.js carries the same array and needs the same edit (source and
bundle must agree). Declaring both names matches the host's own approval plugin
(['sessions','remote','uiSession','slots','locale']); two bundled plugins declare
only the dotted name, so either form works here.
Also worth a look (latent, not failing today)
The same client reads other nested services from arrow functions, so they only
throw once a user triggers that path — connection.state (~client.js:65727),
shortcuts.catalog (~65732), sidebarRight.openTab / sidebarRightTabs (~76069).
Declaring those too would avoid a second round of the same class of report.
Steps to reproduce
- Install ds-bot 0.4.0 on a host that ships
uiSession. - Open the plugin page (or any route that mounts the bot surface).
- The error above appears and bot mode does not start.
Diagnostics
- ds-bot 0.4.0 (npm
ds-bot@0.4.0), DSH desktop 0.2.3-alpha.2, macOS arm64. - Adding
'uiSession', 'uiSession.sessionStatus'to both artifacts locally makes
the surface install again; validation in progress.
Activity
leaderlemon commentedon Nov 27, 2026
Confirmed still present in 0.4.1 (the v0.4.0 hotfix):
src/client/index.js:91still declares the same six services, bothctx.get('uiSession')?.sessionStatusreads are still where they were (:1281,:1772), and the rebuiltclient.jscarries the identical array. AddinguiSession+uiSession.sessionStatusto both artifacts still makes the bot surface install, so the workaround remains valid on 0.4.1.The 0.4.1 notes (activity row, bot private chat tool cards, mailbox toggle) don't touch the client's inject list, so this is expected — just noting it so the fix isn't assumed shipped.
leaderlemon commentedon Nov 27, 2026
Thanks — #2403 is the right generalisation of what I could only band-aid locally, and the reasoning about
0.2.2-rc.5is a real trap I had missed.What I can add from the reporter side, stated precisely:
uiSession.sessionStatusas its own dotted service. On that host, addinguiSessionanduiSession.sessionStatusto the top-levelinjectarray (source + rebuiltclient.js) made the bot surface mount again — same restart, no other change, and the sidebar completion path that reads the status source came back too. So the dotted declaration alone is enough where the dotted service exists; your0.2.2-rc.5note is exactly why it must not be the only shape.devbuild against that host, so I am not claiming fix(client): fix uiSession.sessionStatus inject crash and add DSH plugin-host smoke test #2403 is runtime-verified on 0.2.3-alpha.2 — the static read ofhost-service.js(childctx.inject(['uiSession.sessionStatus'], …)fiber + plain-property fallback) looks right for both layouts, and that is as far as my evidence goes.dev: the other nested service reads in the client (connection.state,shortcuts.catalog,sidebarRight.openTab) already go throughreadServiceMember/callServiceMethod, so there is no second instance of this class left that I could find.