Preface¶
When using the browser to connect to dsh web in DeepSeek Harness (DSH), the workspace preferentially reuses an existing blank session on disk (one where no one has spoken yet), rather than creating a new one every time. Closing the tab and reconnecting often “takes over” the blank session left behind by the previous connection. If the dsh web process from the previous connection is still running, the Host still holds the write lease for that session and will reject with session/writer-held. Although the official client will then create a new session, it throws an error first and then self-heals, and the chat UI still pops up “The current session is already occupied…” — for a genuinely blank session, this message is incorrect.
dsh-blank-handoff is a community-maintained DSH plugin (repository OahzOb/dsh-blank-handoff) that silently forwards the request to a new session in qualifying rejection scenarios, avoiding false alarms. Below it introduces what it does and does not do, as well as how to install it and verify it.
What This Is¶
- Name: dsh-blank-handoff (npm package name matches the GitHub repository)
- Maintainer: OahzOb
- Category: Model inference (SkillHub directory classification)
- Positioning: A DeepSeek Harness plugin; when a blank session is rejected with
session/writer-helddue to a leftover from a previous connection, it forwards to a new session instead of reporting “already occupied” in the chat.
The plugin wraps ctx.sessions.create on the Host side via a Cordis patch; the Web client half loads with the page (platform: web, immediately: true). The plugin runs with the current DSH process’s privileges. Before installing, it is recommended to read the repository source code and the MIT license.
Core Functions¶
Silently Handing Off “Unused Blank Sessions”¶
Each connection starts its own dsh web, each on its own port. When the browser opens, it selects a workspace and tends to reuse a blank session; a blank session created by a previous connection may still be on disk, and the next connection will try to “take over” it (naming sessionId in the request).
If the old connection’s service is still running and still holds the write lease, the Host returns session/writer-held. With this plugin installed: when a request to create a session and specify a session fails due to the above error, the plugin retries without the sessionId, returning a new session. The rejection does not bubble up to the chat layer, and the user will not see:
The current session is already occupied, possibly caused by other running DSH instances (such as other dsh web or desktop clients). Please exit other running DSH instances and try again.
Deliberately Unchanged Behavior¶
When a session is actually being used, the rejection remains effective. A silent handoff only occurs when all of the following conditions are met:
- The request names a session (the typical path for taking over a blank session);
- The error code is
session/writer-held; - The error is specifically about that session;
- That session is not the one already selected in the current chat UI.
If you proactively reopen the session you are currently viewing and get rejected, the error will still be reported as usual. Non-blank sessions that someone is actively using will not go through this handoff path.
Installation and Enabling¶
The DSH ecosystem commonly extends behavior via an “everything is a plugin” approach; the community directory is at SkillHub. There is no official affiliation with DeepSeek / Hundsun Quant. The installation command follows the repository README.
In the profile, use the plugin manager to install the bundle (this writes the dependency and adds it to dsh.profile.bundles; the plugin will not work without either):
plugin_manager install_bundle target: github:OahzOb/dsh-blank-handoff
The manager also supports repository URLs, .tgz files, registry package names, or local absolute paths. The README notes: for local development using link: installation, on Windows the entire profile may fail to start due to junction / realpath issues; a safer approach is a regular file copy or a file: dependency, and ensuring that node_modules contains real files rather than links.
The client logic loads with the page. Tabs already open retain the pre-plugin behavior until refreshed; after installing, you need to reload.
Typical Usage and Self-Check¶
Scenario for Reproducing the Problem (as described in the README)¶
A common desktop path: close the browser tab, reconnect to the same kind of dsh web entry, and the UI previously showed “the previous session is occupied.” After installing the plugin and refreshing the page, the same kind of blank takeover should no longer pop up that message.
One related scenario comes from mobile: dsh-tabs-android encounters similar issues when connecting to a Harness on another machine via SSH.
Verifying the Plugin Works in the Browser¶
The plugin exposes a counter on the page (not relying on the console). After refreshing, execute the following in the DevTools Console:
globalThis.__dshBlankHandoff // { installed: boolean, handedOff: number }
installed: false: The Sessions service is not ready or the client half was not loaded; behavior matches the official version.handedOff: The number of times a silent handoff has been triggered.
Applicable Scenarios and Caveats¶
Who It Is For
- Developers who frequently open/close
dsh webtabs or run multiple ports/instances in parallel, and want to keep the blank-session reuse strategy; - Users connecting remotely / from multiple devices (e.g., Android SSH clients) to the same Harness workspace, who are easily hurt by leftover blank sessions + old-process leases.
Caveats
- The plugin only handles the combination of “blank takeover + writer-held + not the currently selected session”; genuine concurrent usage will still error out, which is the intended design.
- After installing the bundle, be sure to refresh any already-open Web UI; the Host side needs to restart or load the patch according to your profile’s loading method to take effect.
- Stars and versions follow the repository; the current version in
package.jsonis 1.0.0, and you can check GitHub for the latest tag before use.
Conclusion¶
dsh-blank-handoff solves the UX problem in DSH Web where reusing a leftover blank session causes a false “session occupied” report because an old connection still holds the write lease; it silently creates a new session when the rules allow, while preserving the rejection for genuine occupancy.
- Directory page: https://www.skillhub.cn/plugins/OahzOb/dsh-blank-handoff
- Source code and docs: https://github.com/OahzOb/dsh-blank-handoff