Skip to main content

deepseek-harness-desktop/packages/dsh-desktop-compat

156Stars5Forks6Issues0Watchers

Fixes several compatibility issues for DeepSeek Harness desktop client: queue messages not sent after cancellation, stop prompt displaying [object Object], and tool calls for some models having an extra arguments wrapper.

Evidence5/5methodologySourceInstallMaintenanceDSH versionSecurity scan
Machine-auditedInstall commandRepo verifieddsh-plugin topicLicenseREADMEAI wiki

ⓘ This plugin is a sub-package of the ningbainb/deepseek-harness-desktop monorepo — stars and activity count the whole repository.

Language
TypeScript
License
BSD-3-Clause
Branch
main
ai-agentai-coding-assistantcodexdeepseekdeepseek-harnessdesktop-appdshdsh-plugin

Install

cmdweb profile
$ dsh plugin --profile web add --allow-build=@linxin666/dsh-desktop-compat github:ningbainb/deepseek-harness-desktop#path:packages/dsh-desktop-compat

Run the command above in your terminal to install this plugin via the dsh CLI. You can switch Profile in the top-right corner. New to dsh? Read the beginner tutorial

Install via your agent

Install the DeepSeek Harness plugin ningbainb/deepseek-harness-desktop/packages/dsh-desktop-compat for me: review the repository at https://github.com/ningbainb/deepseek-harness-desktop first, then run the install command and verify the plugin loads successfully.

Paste this instruction to the DSH Web GUI assistant — it will install and verify for you.

One-Sentence Description

Patches several specific compatibility issues on DeepSeek Harness Desktop 0.1.0-rc.7—queued messages no longer sent after cancellation, stop prompts displaying as [object Object], some models wrapping tool calls with an extra layer of arguments. It works through public SDK hooks without modifying DSH source code and can be removed once upstream fixes are released.

Core Features

  • Auto-resume normal queued messages after canceling current reply: when agent status enters idle with remaining queue items in inbox, use the public followup hook to re-awaken the official agent driver, preserving FIFO order without duplicating messages
  • Replace tool execution's [object Object] cancellation display with user-friendly Chinese hint: when code run failed (abort) goes through the tools/post-execute hook, replace it with "当前执行已停止,排队消息将继续发送" (Current execution stopped, queued messages will continue to be sent)
  • Fix extra arguments wrapping in model tool calls: some adapters wrap tool arguments in another layer of {"arguments":{...}}; the plugin strictly matches against schema before agent loop parsing, stripping only when outer layer is rejected and inner layer is accepted
  • Maintain theme/skin enable/disable state in desktop isolated profile: auto-migrate legacy entries, safely write by marker segment to avoid overwriting persistence state with official skin center
  • Provide Task Board Host scheduler in desktop background automation mode: mount only when DSH_DESKTOP_BACKGROUND_AUTOMATION=1, use official agent/session/workspace interfaces for scheduling tasks, support session recovery after crashes
  • Control workspace file local opening via local loopback route: restrict to whitelisted non-script extensions only, paths must fall within registered workspace root, use Token to only accept Electron main process requests

Technical Implementation

  • Language: TypeScript (target ES2022, module NodeNext, type module)
  • Key Dependencies: @deepseek-ai/dsh-agent, @deepseek-ai/dsh-tools, @deepseek-ai/dsh-llm, @deepseek-ai/dsh-workspace (all 0.1.0-rc.7, from package.json:38-44)
  • Architecture Pattern: Cordis function plugin + cordis bundle patch; apply(ctx) mounts 4 patch points at once (agent/status events, tools/post-execute middleware, llm/stream global hooks, desktop file open route), and conditionally mounts Host scheduler based on process.env.DSH_DESKTOP_BACKGROUND_AUTOMATION. Declares inject = ['llm','tools','webServer','workspaceRegistry'] to ensure dependency services are ready first
  • Entry File: packages/dsh-desktop-compat/src/index.ts (apply entry; side effects distributed across modules recovery.ts, tool-call-normalization.ts, skin-state.ts, background-scheduler-runner.ts, workspace-file-open-route.ts)

Use Cases

When using DeepSeek Harness Desktop client 0.1.0-rc.7, this plugin directly fixes any of the following: messages queued after cancellation never get auto-sent, vague info like code run failed (abort): [object Object] appears in tool result box after cancellation, or tool calls from some models keep failing due to extra arguments wrapping. It introduces no new features—purely patching missing pieces—so it only makes sense when you see the symptoms above.

Prerequisites & Compatibility

DependencyMinimum VersionNotes
DeepSeek Harness Desktop Host0.1.0-rc.7All dependencies locked to 0.1.0-rc.7 (package.json:38-44); patch list applicableVersions also only lists this version
Node.js^22.19.0 || >=24.0.0package.json:7-9 engines.node
Desktop Isolated ProfileRequiredREADME states "DeepSeek Harness Desktop 2.0 automatically mounts this bundle in isolated desktop profile"—general Web UI profile does not load it
DSH_DESKTOP_WORKSPACE_FILE_OPEN_TOKEN Environment VariableSet at Desktop RuntimeOnly needed when using native file open route; Token is 43-character base64url, randomly generated and validated by desktop main process (src/workspace-file-open-policy.ts:14-21)
DSH_DESKTOP_BACKGROUND_AUTOMATION=1 Environment VariableDesktop Background Automation Mode EnabledOnly set by desktop when user explicitly enables "Minimize to Tray / Background Automation"; if not set, Task Board Host scheduler is skipped, browser-side scheduler continues working
PlatformmacOS / Windows / LinuxCross-platform, no native module dependencies (Node's built-in fs, crypto, node:http)

Installation

dsh plugin --profile web add github:ningbainb/deepseek-harness-desktop/packages/dsh-desktop-compat

Configuration

This plugin requires no additional configuration. All behavior is "patch on missing"—no user-level schema exposed.

ConfigTypeDescriptionDefault
DSH_DESKTOP_BACKGROUND_AUTOMATIONEnvironment Variable (Optional)Set to 1 to enable Task Board desktop Host scheduler (only set when user actively enables "Minimize to Tray / Background Automation" in desktop); if not set, browser-side scheduler is usedNot Set
DSH_DESKTOP_WORKSPACE_FILE_OPEN_TOKENEnvironment Variable (Optional)43-character base64url random string generated by desktop main process, used for Token verification in workspace file local open requests; used only on desktopRandomly generated by desktop main process

FAQ

Q: The installation command shows installing to web profile—will it actually work?

A: This package's source is indeed distributed via the general NPM bundle channel through dsh plugin ... add github:... (cordis.patch.yml:1-5), but README.md:29 explicitly states "DeepSeek Harness Desktop 2.0 automatically mounts this bundle in isolated desktop profile. This package is not provided as a general Web UI plugin"—meaning it's only actually loaded on desktop, web profile is just the installation vehicle. If your desktop client doesn't auto-load, please confirm the client version is 0.1.0-rc.7+ and the isolated desktop profile is enabled.

Q: After using it, can I still use my original "don't queue, send directly" option?

A: Yes. README.md:33 clearly states "Sending still defaults to queuing, steering message behavior won't change"—queue behavior is completely maintained as-is by DSH; the plugin only patches that one "shouldn't stop but stopped" issue after cancellation.

Q: Can it fix all models with extra tool call wrapping?

A: Not guaranteed. It only targets this single-key wrapping pattern {"arguments":{...}} (src/tool-call-normalization.ts:63-66). And ambiguous cases where "both outer and inner pass schema" will actively give up on stripping, keeping original (src/tool-call-normalization.ts:137-142)—DSH's built-in schema validation takes over. Other shapes of wrapping layers are not handled.

Q: Does it write logs? Can tool parameters leak in logs?

A: It writes diagnostic logs but doesn't log raw parameters. Tool call parameter restoration logs outcome, reason, provider, model, tool name, call id, source (src/tool-call-normalization.ts:339-352), but deliberately excludes any tool arguments. Queue restoration failures also log warnings (src/index.ts:46-49).

Q: How do I confirm it's actually working on my desktop?

A: Look for output with dsh-desktop-compat: prefix in desktop startup logs (any patch hit leaves a trace), or run the built-in 6 vitest tests in the package via pnpm --filter @linxin666/dsh-desktop-compat test in debug environment (under tests/ directory).

Q: Once upstream DSH fixes the same issues, what do I need to do?

A: Just uninstall the plugin. src/patch-registry.ts:49-86 has removeWhen conditions for each patch (e.g., "The upstream agent loop natively and deterministically resumes queued turns.")—once conditions are met, the entire package has no reason to exist.

Q: What specific tasks can the Task Board background scheduler run?

A: Only supports "project-based, shared-workspace isolation, must have prompt" tasks (src/background-scheduler-runner.ts:114-118, 216-230). git-worktree isolation, empty prompt, unregistered workspace or unconfigured model are all rejected without error—task is handed to browser-side scheduler to continue finding execution path.

Difficulty Level

Beginner — installation is done automatically by desktop, no user-level configuration, all behavior is "patch on missing" style; regular users don't need to understand SDK hook details, just confirm desktop client version matches and symptoms align. Developers wanting to understand implementation need familiarity with Cordis function plugin, agent/status event streams, and LLM stream chunk protocol.

Known Issues & Limitations

  • Only compatible with DSH 0.1.0-rc.7: each patch in the patch list has applicableVersions listing only this version (src/patch-registry.ts:49-86); other versions need to wait for patch updates on desktop first
  • Tool call parameter restoration only strips when "outer schema rejects, inner schema accepts": other cases (both pass, both reject, unknown tool, duplicate tool schema) are left untouched; diagnostics include reason specifying exact cause (src/tool-call-normalization.ts:21-28, 100-152)
  • Once upstream implements the same cancellation resume / cancellation display / arguments wrapping handling, this package loses its purpose (README.md:35-37, various removeWhen fields in src/patch-registry.ts)
  • Background Host scheduler only takes over shared-workspace isolation, git-worktree isolation is explicitly rejected with fallbackReason written (src/background-scheduler-runner.ts:256-258)
  • Workspace file local open only accepts whitelisted extensions, scripts (.js, .ts, .html, .svg, etc.) are explicitly excluded (src/workspace-file-open-policy.ts:28-44), path must be within registered workspace root (src/workspace-file-open-route.ts)
  • General Web UI profile doesn't auto-load this bundle, needs desktop's isolated desktop profile (README.md:29)

Read the usage guide →

Install steps, key points, FAQ and compatibility for this plugin — auto-derived from indexed fields.

Listing badge

Listed on deepseek-plugin.org
[![Listed on deepseek-plugin.org](https://img.shields.io/badge/listed_on-deepseek--plugin.org-007EC6)](https://deepseek-plugin.org/plugins/ningbainb/deepseek-harness-desktop/packages/dsh-desktop-compat)

Paste this markdown into your GitHub README to link back to this listing. The badge only states the listing — not a security endorsement.

← Back to plugin directory