dsh-lsp-bridge: Integrating the Language Server into DeepSeek Harness

Preface

In DeepSeek Harness (DSH), common approaches for letting the model read code are full-file search or parsing the AST yourself. When there are many files and cross-module references become complex, it’s easy to miss symbols or get line numbers wrong. Language servers (LSP) are designed for exactly these kinds of semantic queries — “hover, definition, references, diagnostics”. If the DSH session side lacks a unified entry point, you’d have to configure gopls, pyright, typescript-language-server, etc. separately in each project, and also handle multi-repo workspaces and process lifecycle.

Below we introduce the community plugin dsh-lsp-bridge (maintainer voidmind26): it connects the Harness to stdio language servers, exposes the lsp query tool externally, and supports model-driven lsp_setup installation and configuration, multi-language discovery, multi-root workspaces, and per-session server instance reuse. The current plugin version is 0.3.0 (MIT), requires Node.js ≥ 22, and requires no compilation during installation.

What is this

dsh-lsp-bridge is a DSH Bundle plugin: it mounts cordis.patch.yml via dsh.bundle.patch in package.json, and is not tied to any personal path or profile. It provides the LLM with a general LSP tool lsp, primarily for read-only semantic queries (the README also mentions permission-constrained modification capabilities); the specific capabilities depend on the language server being connected.

It is categorized as “Model Inference” in the SkillHub directory. See GitHub: voidmind26/dsh-lsp-bridge for source code and documentation.

Core Features

Operations supported by the lsp tool

The plugin encapsulates LSP capabilities as operations with JSON input arguments. Common items are as follows (see the README for the full table):

operation Purpose Extra required parameters
status View configured services; does not start language servers None
hover Types and documentation file, line, character
definition Jump to definition file, line, character
typeDefinition Type definition file, line, character
implementation Implementation locations file, line, character
references References (including declarations) file, line, character
documentSymbols Document symbols file
workspaceSymbols Symbols in the selected project/multi-root workspace query; server and root recommended explicitly
diagnostics Single-file diagnostics file

Conventions: input line / character start from 1, and character is counted in UTF-16; output retains the original LSP URI, and range starts from 0. server is used to disambiguate among multiple language services; paths are relative to the current session working directory, and absolute paths may also be used.

lsp_setup: model-side installation and configuration

The README recommends not manually scanning or hand-writing complete configurations, but instead letting the agent call lsp_setup:

operation Behavior Runs programs?
status Diagnose project and servers, report missing items and available installation schemes No
install Execute installation commands within the catalog allowlist (requires apply=true) Yes
configure Write available servers into plugin configuration No
verify Actually start and complete initialize, report capabilities and errors Yes
auto Chain the above steps (installation requires apply=true) Depends on apply

Key security boundary points: installation commands come from the frozen src/catalog.js; the model cannot define its own shell commands; no shell is used, no sudo; only install/auto with apply=true will install; the default installation directory is $DSH_HOME/lsp-bridge (usually ~/.dsh/lsp-bridge on local machines), and business projects are not modified; each call requires the session to be danger-full-access, and privilege escalation is not automatic.

Multi-language, multi-root, and session reuse

  • Supports configuring multiple stdio language servers by language, with fields including command/args, languages, rootMarkers, roots, workspaceFolders, initializationOptions, etc. (see the README’s “General Configuration”).
  • The language server evaluation directory is determined by the configured roots/workspaceFolders, not the “current session directory” itself; the session is mainly responsible for authorization and the default workspace when roots are not declared. When querying, file/root must still fall within the session workspace.
  • The plugin pools language server processes: session-scoped server reuse (reused within the same session, idle instances can be reclaimed), with configurable timeoutMs, maxInstances, idleTimeoutMs, maxSessions, etc.

Settings UI and automatic discovery

After a full restart of the Desktop or Web host, you can use a dedicated page under “Settings → LSP”: server list, read-only diagnostics, brief initialize verification, and scanning Go/Rust/TS·JS/Python/C++ etc. candidates according to the catalog. Scanning is read-only and does not install; installation still goes through lsp_setup with apply=true. Web and Desktop share the platform: web client Bundle.

Installation and Activation

The plugin has been verified against the interfaces of DSH 0.1.5-rc.2 / Desktop 2.0.10; other versions need to be verified by yourself. Installing the plugin itself does not download or start any language server (default servers: []).

Web profile

When DSH CLI is installed and pnpm is in PATH, run in the plugin directory:

dsh plugin --profile web add github:voidmind26/dsh-lsp-bridge

You should use an already initialized web profile; after installation, restart the existing web process and refresh the page. Uninstall:

dsh plugin --profile web remove dsh-lsp-bridge

Desktop profile (README uses macOS as an example)

The regular CLI will refuse the reserved desktop profile; you need to use the Desktop’s built-in entry point. Example:

dsh_packaged() {
  ELECTRON_RUN_AS_NODE=1 '/Applications/DSH Desktop.app/Contents/MacOS/DSH Desktop' \
    --expose-internals '/Applications/DSH Desktop.app/Contents/Resources/app/lib/desktop-cli.js' "$@"
}
dsh_packaged plugin --profile desktop add github:voidmind26/dsh-lsp-bridge

After installation, restart the Desktop and refresh the GUI. Uninstall: dsh_packaged plugin --profile desktop remove dsh-lsp-bridge. Other operating systems need to use the CLI entry point provided by that Desktop; the README does not state that this has been verified.

Manual configuration (optional)

  1. Merge the id: lsp configuration override from examples/cordis.patch.yml into the top-level array of $DSH_HOME/profiles/web/cordis.patch.yml or $DSH_HOME/profiles/desktop/cordis.patch.yml (DSH_HOME defaults to ~/.dsh). config is a wholesale replacement, not a deep merge.
  2. Fill in servers; the GUI’s PATH may differ from the terminal’s, so write absolute paths for server commands if necessary.
  3. If you have previously manually inserted id: lsp, remove the old insertion during migration to avoid duplicate registration with the Bundle.
  4. Use danger-full-access in the target project session, first run lsp’s status, then query definitions in real files.

Typical Usage

Querying definitions

Row/column must be replaced with the actual position of the target symbol in the file (below is a README parameter example):

{"operation":"definition","file":"qsl-game-server/main.go","line":20,"character":8,"server":"go"}

Workspace symbols

{"operation":"workspaceSymbols","server":"go","root":"unityroomlib","query":"Router"}

The tool returns something like { "json": "...", "truncated": false }; the GUI/LLM displays the content of the json field. If the result is too long, it will carry a truncated preview, and the preview cannot be treated as the complete result.

  1. Install the Bundle and restart the host.
  2. In a danger-full-access session, let the agent execute lsp_setup’s status or auto (set apply=true when installation is needed).
  3. Call lsp’s status to confirm services are ready.
  4. Execute operations such as definition, hover, or diagnostics on real paths within the repository.

Use Cases and Caveats

Who it’s for: Anyone already doing code-related agents in DSH Web or Desktop, who wants the model to do definition jumps, references, symbol search, and single-file diagnostics via LSP rather than relying solely on full-text search; scenarios with multi-language, multi-repo monorepos needing roots/workspaceFolders can also choose from the three “project root” modes in the README.

Be sure to be aware of:

  • The plugin and language servers run with the current DSH process’s permissions; before installing, read the source code and the MIT license, and understand that lsp_setup only executes commands in the catalog within directories like $DSH_HOME/lsp-bridge when explicitly apply=true.
  • C/C++ clangd has no portable installation scheme in the catalog; the README only gives manual installation suggestions.
  • The built-in catalog covers common stacks; other stdio-LSP-compatible servers can still be manually configured, but this does not mean the plugin will automatically download language SDKs (e.g., when only typescript-language-server is present without the TypeScript SDK, status will report missing-dependency).
  • The README states: the automated tests for existing protocols and Bundle structure are not equivalent to your installation result on a real web/Desktop profile; when troubleshooting configuration, in addition to the profile layer, you can also check $DSH_HOME/cordis.patch.yml.

The DSH ecosystem emphasizes “everything is a plugin”; SkillHub is a community directory site, with no official affiliation with DeepSeek / High-Flyer.

Conclusion

dsh-lsp-bridge consolidates queries, configuration, and lifecycle between the Harness session and stdio language servers into two paths — lsp / lsp_setup — supplemented by the “Settings → LSP” discovery and verification interface. If your agent needs to perform stable code semantic retrieval in DSH, you can install it using the commands above, complete setup under controlled permissions, and then verify definition and diagnostics with real file coordinates.

羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye