Repository navigation
[Bug] Live profile reload leaves session-scoped services unavailable: session/follow fails with gateway/service-unavailable #9100
pridurok-goxa
started this conversation in
General
Replies: 1 comment
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.
Environment
0.2.0-rc.2(@deepseek-ai/dsh), Node.js v22.23.3, Linux x64web(dsh web), long-running service (process uptime ~29 h at the time)dsh.profile.bundleschanges while the process is liveSummary
Installing a bundle into the running Web server left the process half-alive: the shell kept loading, but every client call into a session-scoped service failed.
dsh-api-gateway/lib/index.jsraises this inprepareInvocation():The RPC reaches the gateway and the descriptor resolves, but the service instance is not registered on the resolved receiver context. Reloading the page does not help — the broken state lives in the server process, and only a process restart clears it.
Steps to reproduce
dsh webwith a profile whose bundle stack enables HMR. The shippedwebprofile does: thehmrentry comes from@deepseek-ai/dsh-base(root: []) and stays enabled while the launcher suppliesprofileContext.package.json/pnpm-lock.yamland, becausehmris present, applies the change in-process (dsh-plugin-manager→reload()→reconcileProfilePatches(root, readProfilePatches(...), "dsh", requiredIds)).Observed once, after installing a bundle that declares a new agent preset (
@deepseek-ai/dsh-agent-presetwith a nestedplugins:list) and overridessession-query-sqlite. I could not re-run it on demand, because after the failure the bundle was already in the profile.Expected
One of these, not a partial tree:
application: "restart-required"(exactly what already happens whenhmris absent) and leave the running tree untouched.Partial application is the worst case: the HTTP shell stays up, so the UI looks alive while session-scoped services are silently gone.
Workaround in use
Disable HMR in the profile so profile changes always require a restart:
With that,
plugin-manager.change()returnsapplication: "restart-required"(seedsh-plugin-manager/lib/index.js), the live tree is never touched, and an explicit restart applies the new profile — which matches the documented intent in@deepseek-ai/dsh-hmr/README.md: "Disabling or omitting HMR applies changes on restart."Related asymmetry worth a look: when
hmris absent, removing/disabling an already-started bundle throwsstop-profile(same file, therestart-requiredfallback path), so the removal path refuses to touch a live tree. The install path should be equally strict.Evidence
dsh --profile web --dump-configstill composed the tree successfully (exit 0) and the tree still containedsession-controller(@deepseek-ai/dsh-api-session-controller) — the profile files were fine, only the running process was broken.session/followcall over/api/remote.muxthen returned a normalsnapshotframe, and other client plugins recovered.All reactions