Skip to content

Feature: add DSH (DeepSeek Harness) as a serena-hooks client #1869

Description

@lplnb-del

Is your feature request related to a problem? Please describe.

Serena works with DSH (DeepSeek Harness, https://github.com/deepseek-ai/deepseek-harness) today via manual MCP config — registering the Serena MCP server through DSH's @deepseek-ai/dsh-mcp-client plugin (~/.dsh/cordis.patch.yml). However, serena-hooks does not support DSH as a --client, so none of the lifecycle hooks (activate, remind, cleanup, auto-approve) can be wired up for DSH sessions.

Describe the solution you'd like

Add dsh to the --client enum in serena-hooks (currently claude-code|codebuddy|vscode|codex|grok), so these commands work:

serena-hooks activate --client dsh
serena-hooks remind --client dsh
serena-hooks cleanup --client dsh
serena-hooks auto-approve --client dsh

DSH supports Claude Code-compatible hooks via its @deepseek-ai/dsh-hooks-claude-code bridge plugin, which reads a Claude Code-style hooks.json. It supports these events: SessionStart, UserPromptSubmit, PreToolUse, PostToolUse, Stop, SubagentStart, SubagentStop (note: no SessionEnd). These map onto Serena's hooks as:

Serena hook DSH event Notes
activate SessionStart inject "activate project + read instructions"
remind PreToolUse nudge toward symbolic tools on grep/read overuse
auto-approve PreToolUse auto-approve Serena tool calls
cleanup Stop closest available event; DSH has no SessionEnd (same mapping ZCode uses)

DSH hook config format (written to ~/.dsh/hooks.json, enabled via @deepseek-ai/dsh-hooks-claude-code with configPath in cordis.patch.yml):

{
  "SessionStart": [
    { "matcher": "", "hooks": [ { "type": "command", "command": "serena-hooks activate --client dsh" } ] }
  ],
  "PreToolUse": [
    { "matcher": "", "hooks": [ { "type": "command", "command": "serena-hooks remind --client dsh" } ] },
    { "matcher": "mcp__serena__*", "hooks": [ { "type": "command", "command": "serena-hooks auto-approve --client dsh" } ] }
  ],
  "Stop": [
    { "matcher": "", "hooks": [ { "type": "command", "command": "serena-hooks cleanup --client dsh" } ] }
  ]
}

Describe alternatives you've considered

  • Manually replicating the hook behavior via DSH's .agents/ instructions (current workaround — works, but no automatic activation/reminders).
  • Waiting on DSH to add a SessionEnd event so cleanup can map 1:1 like Claude Code — but Stop is a workable approximation today, matching the existing ZCode mapping.

Additional context

  • DSH repo: https://github.com/deepseek-ai/deepseek-harness
  • DSH hooks bridge: packages/hooks/hooks-claude-code (@deepseek-ai/dsh-hooks-claude-code)
  • Serena MCP config on DSH (for reference):
    - insert:
        - id: mcp-serena
          name: '@deepseek-ai/dsh-mcp-client'
          config:
            serverName: serena
            transport: stdio
            command: serena
            args: [start-mcp-server, --context, agent, --project-from-cwd]
  • This mirrors the existing ZCode feature request (Feature: add ZCode (Z.ai) as a serena-hooks client #1837) and Grok/CodeBuddy/Devin precedent for adding a new --client.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions