Skip to content

FR: Support DSH (DeepSeek Harness) #3847

In review

Description

@liangxz-bio

When will DSH (DeepSeek Harness) support be added?

Activity

  1. liangxz-bio commented on Oct 1, 2026

    @liangxz-bio
    Author

    rtk init --agent dsh
    error: invalid value 'dsh' for '--agent '
    [possible values: claude, cursor, trae, windsurf, cline, kilocode, antigravity, kimi, pi, hermes, droid, vibe, omp]

    For more information, try '--help'.

  2. ismoss commented on Oct 29, 2026

    @ismoss

    Small update for people landing here from the issue: DSH can use rtk today, without a native hook.

    A dsh plugin can wrap ctx.shell.execute — the seam every pwsh/bash tool call and every background job goes through — and rewrite the command with rtk rewrite -- <cmd> before it runs. Verified on dsh 0.2.1-rc.3 / Windows: git status --porcelain executes as rtk git status --porcelain, and rtk gain counts the run.

    So rtk init --agent dsh (the instructions-only path in #4809) is still worth having for the other agents' install experience, but it is not the only way to get DSH onto rtk. Details, plus the exit-code contract and the token-level safety check I would like to see documented, are in #4809 (comment).

  3. KuSh commented on Oct 31, 2026

    @KuSh
    Collaborator

    There are 2 open pull requests for this issue: #3934, #4809 (oldest first).

    If you were about to start on it, reviewing or testing one of these helps more than another pull request: a note on which approach fits, or a test result on your setup, is welcome on the pull request itself.

  4. fatinghenji commented on Nov 12, 2026

    @fatinghenji

    Verified on DSH 0.2.2-rc.2: rtk runs today, but there is still no native --agent dsh

    I tested the current release end to end inside a real DSH session, since this issue asks what is usable right now versus what still needs the PRs.

    Environment: rtk 1.2.0 (official Windows x86_64 release, 2026-11-08), DSH 0.2.2-rc.2, Windows 10.0.26300 (x64), Windows PowerShell 5.1.

    What works

    Check Observed
    rtk --version rtk 1.2.0
    rtk rewrite -- "git status --porcelain" prints rtk git status --porcelain, exit 3 (rewrite, host decides approval)
    rtk rewrite -- "echo hello" no output, exit 1 (no-op)
    rtk git status in a test repo 20 bytes vs 190 bytes for native git status (~89% smaller)
    rtk gain after 4 commands 114 input → 26 output tokens, 77.2% saved, no errors
    ctx.shell.execute(ctx.shell.resolve({...})) present in 0.2.2-rc.2 and used by DSH itself, so the plugin wrapper discussed in #4809 remains the viable seam

    So the "no hook, but a plugin seam" summary earlier in this thread still holds on 0.2.2-rc.2.

    What does not work yet

    rtk init --agent dsh is still rejected on 1.2.0:

    error: invalid value 'dsh' for '--agent <AGENT>'
      [possible values: claude, cursor, trae, windsurf, cline, kilocode, antigravity, kimi, pi, hermes, droid, vibe, omp]
    

    exit code 2. The v1.2.0 AgentTarget enum has no DSH variant, so #3934 (instructions) and #4809 (init target + shell plugin) are still needed for a native path. Until then, the manual/third-party route is the only one.

    Installation notes for host integrations (from actually running it sandboxed)

    1. State directory. rtk keeps its tracking DB under %APPDATA%\rtk. Under DSH's default workspace-write sandbox that write is denied and rtk gain fails with Failed to initialize tracking database: 拒绝访问。 (os error 5) — filtering still works, only accounting breaks. Setting RTK_CONFIG_DIR (and optionally RTK_DB_PATH) to a writable location fixes it; that is how the numbers above were measured. A host integration should either allow that path or set these env vars for rtk.
    2. PATH. The Windows archive is a single rtk.exe; the plugin path resolves rtk from PATH (or a configured rtk: path), so it has to be installed where the harness shell can see it.
    3. stderr noise. Outside a hook, rtk prints [rtk] /!\ No hook installed — run rtk init -g ... on stderr; RTK_SUPPRESS_HOOK_WARNING=1 silences it.
    4. Rewrite contract for hosts. 0/3 = use the rewritten command (3 = defer the approval decision), 1 = pass through, 2 = deny. A host must accept 0 and 3, and otherwise run the original untouched.
    5. No pre-tool rewrite in DSH (tools/pre-execute is allow/deny only), so ctx.shell.execute stays the only seam; session history and the UI still show the original command.

    Manual setup that works today, if useful for the docs:

    rtk git status          # compact output
    rtk cargo test          # filtered test output
    rtk gain                # savings (needs a writable RTK_CONFIG_DIR in a sandbox)

    It would help to document rtk rewrite's exit-code contract and the RTK_CONFIG_DIR behavior for sandboxed hosts, since both bite any integration that is not a Claude-Code-style hook.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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