You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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).
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.
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)
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.
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.
stderr noise. Outside a hook, rtk prints [rtk] /!\ No hook installed — run rtk init -g ... on stderr; RTK_SUPPRESS_HOOK_WARNING=1 silences it.
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.
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.
Activity
liangxz-bio commentedon Oct 1, 2026
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'.
library, gui: DeepSeek Harness is listed under Library › RTK with why…
library: RTK's tag for Grok Build and Grok App gives their own reason…
library: RTK's tag for Grok Build and Grok App gives their own reason…
ismoss commentedon Oct 29, 2026
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 everypwsh/bashtool call and every background job goes through — and rewrite the command withrtk rewrite -- <cmd>before it runs. Verified on dsh 0.2.1-rc.3 / Windows:git status --porcelainexecutes asrtk git status --porcelain, andrtk gaincounts 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).KuSh commentedon Oct 31, 2026
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.
fatinghenji commentedon Nov 12, 2026
Verified on DSH 0.2.2-rc.2: rtk runs today, but there is still no native
--agent dshI 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
rtk --versionrtk 1.2.0rtk rewrite -- "git status --porcelain"rtk git status --porcelain, exit 3 (rewrite, host decides approval)rtk rewrite -- "echo hello"rtk git statusin a test repogit status(~89% smaller)rtk gainafter 4 commandsctx.shell.execute(ctx.shell.resolve({...}))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 dshis still rejected on 1.2.0:exit code 2. The v1.2.0
AgentTargetenum 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)
%APPDATA%\rtk. Under DSH's defaultworkspace-writesandbox that write is denied andrtk gainfails withFailed to initialize tracking database: 拒绝访问。 (os error 5)— filtering still works, only accounting breaks. SettingRTK_CONFIG_DIR(and optionallyRTK_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.rtk.exe; the plugin path resolves rtk fromPATH(or a configuredrtk:path), so it has to be installed where the harness shell can see it.[rtk] /!\ No hook installed — run rtk init -g ...on stderr;RTK_SUPPRESS_HOOK_WARNING=1silences it.tools/pre-executeis allow/deny only), soctx.shell.executestays the only seam; session history and the UI still show the original command.Manual setup that works today, if useful for the docs:
It would help to document
rtk rewrite's exit-code contract and theRTK_CONFIG_DIRbehavior for sandboxed hosts, since both bite any integration that is not a Claude-Code-style hook.