Introduction¶
In the development practice of DeepSeek Harness (DSH), agents sometimes need to look up code structures (such as class names and function names) by symbol name alone, without fetching file contents or locating the cursor. Traditional LSP tools (such as goToDefinition) usually rely on context. dsh-workspace-intelligence addresses this requirement by providing DSH with a standalone workspace_symbol tool that allows agents to perform deterministic searches using the standard LSP workspace/symbol request.
Plugin Scope¶
dsh-workspace-intelligence is a standalone DSH/Cordis plugin.
It focuses on deterministic LSP workspace symbol search. The plugin does not modify DeepSeek Harness core code and does not call ctx.lsp directly; instead, it communicates with LSP through the public ctx.fs, ctx.subprocess, and ctx.tools contexts. It is compatible with multiple response formats, including SymbolInformation[], WorkspaceSymbol[], URI-only locations, null, and empty arrays, ensuring predictable behavior.
Installation and Enabling¶
The plugin is disabled by default because the Language Server startup command must be specified by the deployer.
- Install the plugin
Use the official installation command to add the plugin to the specified Profile.
dsh plugin --profile <name> add dsh-workspace-intelligence
- Install dependencies
Install Node.js (requires^22.19.0or>=24) and at least one language server that supports stdio LSP (example).
pnpm add -g pyright typescript typescript-language-server
-
Configure the Language Server
The deployer must configure the language server in the Profile’scordis.patch.yml. Perform the following steps according to the operating system:-
Windows
Runpnpm root -gto obtain the global directory. Mergeexamples/windows/cordis.patch.ymlinto the Profile configuration. ReplaceC:/pnpm-global-rootwith the actual output path (make sure to use/as the path separator). Keep the absolute path form ofnodeplus the JS file, and do not use the.cmdshim;ctx.subprocessdoes not go through a shell. -
macOS/Linux
Mergeexamples/macos-linux/cordis.patch.ymlinto the Profile’scordis.patch.yml. The template starts the language server directly from PATH. -
Verify configuration
After merging, inspect the resolved result to ensure the configuration is correct.
-
dsh --profile <name> --dump-config
Usage¶
When calling this tool, the model only needs to pass a single required parameter.
{ "query": "SessionManager" }
- Parameter restrictions: A blank query is rejected. The model cannot choose the provider, command, workspace, or timeout.
- Response contents: The result includes the symbol name, a readable
kind, a canonical URI, an optionalrange, andcontainerName.
Configuration¶
The servers configuration item is required and must contain at least one entry. Server IDs are sorted lexicographically, so object insertion order does not affect behavior.
| Setting | Default | Description |
|---|---|---|
command |
Required | Absolute path to the executable or command name resolved by ctx.subprocess |
args |
[] |
argv passed directly, without a shell |
env |
{} |
Incremental environment variables for the subprocess |
initializationOptions |
null |
LSP initialization parameters |
configuration |
null |
workspace/configuration response value |
maxMessageBytes |
16000000 |
Upper limit for a single LSP message |
maxStderrBytes |
1000000 |
Upper limit for the stderr diagnostic tail |
shutdownTimeoutMs |
5000 |
Graceful shutdown wait time |
killGraceMs |
2000 |
Process tree termination wait time |
maxResults |
100 |
Number of symbols retained after merging and deduplication |
maxResultChars |
16000 |
Character budget for the full model output, minimum 256 |
timeoutMs |
60000 |
Tool timeout metadata passed to the DSH timeout policy |
Behavior and Limitations¶
- Concurrency and ordering: A query is fanned out to all configured servers; within the same server, requests are serial. Results are stably sorted by exact match, prefix match, other results, server ID, and original order.
- Deduplication rule: The deduplication key is
name + kind + URI + optional range. The first item after sorting is retained. - Error handling: If any provider succeeds (including an empty result), the response is successful; failures and unsupported providers are only counted. If all providers are unsupported, report
WORKSPACE_SYMBOL_UNSUPPORTED; if there are failures and no successful results, reportWORKSPACE_SYMBOL_PROVIDER_FAILED. - Cancellation policy: Caller cancellation sends a best-effort
$/cancelRequestand rejects as-is; it does not become a partial success. - Process management: For each canonical workspace/server, one process is lazily reused. During unloading, the tool is removed first, then shutdown, exit, and process-tree termination are executed.
- Unsupported features: No grep fallback, document symbols, call hierarchy, embedding, raw JSON-RPC, or cursor-based LSP operations are provided.
Conclusion¶
dsh-workspace-intelligence provides a deterministic, context-independent symbol search capability. It embodies the “everything is a plugin” philosophy in the DSH ecosystem. The plugin is released under the MIT License and is suitable for development scenarios that require code structure queries at the agent level.
- Project directory: https://www.skillhub.cn/plugins/shiki-dml/dsh-workspace-intelligence
- Source repository: https://github.com/shiki-dml/dsh-workspace-intelligence