Skip to content

feat(init): add DeepSeek Harness (DSH) agent support - #4809

Open
nrenvo wants to merge 6 commits into
rtk-ai:developfrom
nrenvo:feat/dsh-agent-support
Open

nrenvo wants to merge 6 commits into
rtk-ai:developfrom
nrenvo:feat/dsh-agent-support

Conversation

@nrenvo

@nrenvo nrenvo commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Adds DeepSeek Harness to rtk init, in two parts.

Part 1 (original scope): DSH reads AGENTS.md at the harness home ($DSH_HOME, default ~/.dsh) and every directory from the project root down to the cwd. It has no command hook, so the instructions file is the only surface. rtk init --agent dsh writes to ./AGENTS.md, rtk init -g --agent dsh writes to $DSH_HOME/AGENTS.md, --uninstall removes it and keeps user content.

Part 2 (this update): DSH's tools/pre-execute event is allow/deny only, it can't rewrite the command text. The only seam that can change a command before it runs is ctx.shell, a cordis service every bash/pwsh call resolves through. A global install (-g) now also installs a cordis plugin into every DSH profile that patches ctx.shell.execute, asks rtk rewrite for the RTK form, and swaps the command before it spawns. Local install is unchanged, AGENTS.md only, since the plugin is machine level config.

Safety: only accepts an allow or ask rewrite from rtk rewrite, verified to be the original command with just an rtk prefix inserted and nothing else changed, and only for a whitelisted set of subcommands. A deny is left to DSH's own permission system.

Known limitation, documented in hooks/dsh/README.md: this is a post hoc substitution not a real pre execution hook, so DSH's own session history and UI still show the original command. A persistent terminal session doesn't go through ctx.shell and is never rewritten.

Test plan

  • cargo fmt, cargo clippy with no warnings, cargo test --lib with 4551 passed including 33 new ones for profile discovery and the patch file append and remove logic
  • cargo test --all has no new failures, the 3 failures that do show up are already there on the base commit without this change, checked with git stash
  • node --test on the plugin's own test file, 33 passed, covering the token insertion check and exit code handling against a mock rtk binary
  • Manual install and uninstall against an isolated DSH_HOME, repeat runs are no-ops
  • Manual test on this machine's real running DSH desktop app: installed for real, DSH picked it up within seconds with no restart. A live unprefixed git status became rtk git status. A live grep chained after cd && only had the grep side rewritten. A live echo hello stayed unchanged. Uninstalled afterward and every touched file came back identical to its original content

Closes #3847

DSH loads AGENTS.md at two scopes: the harness home ($DSH_HOME, default
~/.dsh) and, from the .git project root down to the cwd, each directory as
the agent reaches it. It has no user-configurable command hook, so the only
surface to configure is the instructions file; the `full` awareness block
teaches the agent to prefix its own shell commands with `rtk`.

- `rtk init --agent dsh` writes the block to ./AGENTS.md
- `rtk init -g --agent dsh` writes it to $DSH_HOME/AGENTS.md
- `--uninstall` removes the block and leaves user content intact
- `dsh::is_configured` joins AGENT_PROBES, so a configured DSH suppresses
  the "No hook installed" warning

The awareness note shared by every instructions-only agent moves to
`init/mod.rs`, where the other cross-module helpers already live, so DSH
reuses it instead of carrying a copy.
@rtk-wshm-sync-bot

Copy link
Copy Markdown

wshm · Automated triage by AI

📊 Automated PR Analysis

✨ Type feature
🟢 Risk low

Summary

Adds DeepSeek Harness (DSH) agent support to rtk init, writing an RTK awareness block into AGENTS.md (locally or at $DSH_HOME globally) since DSH has no configurable command hook. Also wires DSH into agent detection, the hook-configured probe list, and shares the instructions-only awareness note helper by moving it to init/mod.rs.

Review Checklist

  • Tests present
  • Breaking change
  • Docs updated

Analyzed automatically by wshm · This is an automated analysis, not a human review.

@nrenvo

nrenvo commented Oct 28, 2026

Copy link
Copy Markdown
Contributor Author

Hey @KuSh 👋 small one for you: adds DeepSeek Harness to rtk init, instructions-only since DSH has no command hook (it just reads AGENTS.md at the harness home and from the project root down).

The one call I'd like a second opinion on: I left DSH out of engine/src/harness.rs — every field there is hook shaped and DSH has no tool-call hook, so a profile would promise read/deny/rewrite that doesn't exist. Happy to add one if you'd rather have the consistency.

No rush, whenever you get a chance, thanks!

@ismoss

ismoss commented Oct 29, 2026 •

Copy link
Copy Markdown

A dsh-side rewrite path does exist — it is plugin shaped, not hook shaped.

@nrenvo's read is right at the hook layer: DSH has no PreToolUse rewrite (tools/pre-execute is allow/deny/ask only, and the Claude Code / Codex bridge warns and drops updatedInput; there is a proposed note for a proper pre-tool input rewrite, not implemented).

What DSH does expose to plugins is the shell capability itself: a plugin can wrap ctx.shell.execute, which is the seam every pwsh/bash tool call and every background job goes through. I built that wrapper against dsh 0.2.1-rc.3 on Windows and it works end to end — git -C … status --porcelain runs as rtk git -C … status --porcelain, and rtk's own accounting sees the run (rtk gain increments). So for DSH the accurate summary is "no hook, but a plugin seam", not "no rewrite possible".

I built it on rtk rewrite -- <cmd> and treated its exit codes as the contract: 0/3 rewrite (3 = defer the approval decision to the host), 1 no-op, 2 deny → run the original untouched. Two rules that came out of testing, and that would be worth writing down if this ever becomes a formal integration surface:

  • accept only 0/3; anything unknown, timed out, or missing passes through unmodified. A host must never turn "rtk is not sure" into "run something else";
  • verify the rewrite is a pure rtk insertion at token level (split on && || | ; &): drop the inserted rtk tokens and the result must equal the original token for token. DSH's own consistency note requires the executed command and the audited one to differ by a filter, not by an argument, so the wrapper refuses any rewrite that adds, drops or requotes a token. It costs an occasional saving and buys the guarantee.

On the question in the PR: I don't think DSH needs a HarnessProfile row — nothing hook shaped exists to fill it with, so the deliberate omission looks right. But documenting rtk rewrite's exit-code contract as a host-integration surface (rather than an internal called by the shipped hooks) would let any host without hooks integrate without rtk growing a per-agent hook. DSH is one; there will be others.

Happy to share the plugin as a reference implementation if that is useful for the discussion.

Reference implementation (MIT): https://github.com/ismoss/dsh-rtk — the wrapper, the exit-code handling and the token check, with the tests that came out of it.

DSH's `tools/pre-execute` event is allow/deny only and cannot rewrite
`exec.arguments`. The only seam that can change a command's text before it
runs is `ctx.shell`, a cordis service every bash/pwsh tool call and
background job resolves through. A global install (`-g`, machine-level,
same scope as the plugin's own profile data) now installs a cordis plugin
(`hooks/dsh/rtk-rewrite/`) into every discovered DSH profile that patches
`ctx.shell.execute`, asks `rtk rewrite` for the RTK form, and swaps the
spawned command text when one is accepted. A project-local install (no
`-g`) is unchanged: only the AGENTS.md awareness block.

- `ctx.shell` is a cordis-tracked service proxy (a fresh wrapper per
  access), so the patch targets the real instance behind
  `Symbol.for("cordis.original")`, not whatever proxy a given access
  returns.
- Only `rtk rewrite` exit 0/3 are accepted; a deny (exit 2) is left to
  DSH's own permission system, never simulated.
- A rewrite is only applied when it is provably the original command with
  one or more literal `rtk`/`rtk.exe` tokens inserted (tokenized on shell
  operators), and when every inserted `rtk <name>` prefix names a
  subcommand on a trusted whitelist that excludes host-sensitive aliases
  (PowerShell's `ls` returns an object stream, not text).
- Install/uninstall operate on every profile under
  `$DSH_HOME/profiles/` (a directory counts as a profile when it has its
  own `package.json`, which excludes the shared pnpm-hoisted
  `profiles/node_modules/`), writing the plugin package and appending one
  idempotent `insert` entry to each profile's own `cordis.patch.yml`
  without touching any other entry already there. Uninstall removes
  exactly that.
- Known limitation documented in `hooks/dsh/README.md`: this is a
  post-hoc substitution, not a real pre-execution hook, so DSH's session
  history and UI still show the model's original command; a persistent
  terminal (pty) session does not go through `ctx.shell` at all and is
  never rewritten.

Testing:

- `cargo fmt --all && cargo fmt --manifest-path proxy/Cargo.toml --all`
- `cargo clippy --all-targets`: no warnings
- `cargo test --lib`: 4551 passed, 0 failed (33 new DSH tests)
- `cargo test --all`: no new failures (3 pre-existing failures in
  `guard_integration_test`/`ng_build_test`, confirmed present on
  `develop` before this change, environment-dependent and unrelated)
- `node --test hooks/dsh/rtk-rewrite/rtk.test.mjs`: 33 passed
- Manual: install/uninstall/dry-run/idempotency against an isolated
  `$DSH_HOME`
- Manual, against this machine's real DSH desktop app (installed, HMR
  reload observed within seconds, no restart needed, then fully
  uninstalled and the profile files diffed back to their original
  content): a live, unprefixed `git status` from this machine's actual
  DSH bash tool was intercepted and rewritten to `rtk git status`
  (confirmed via the plugin's own rewrite log); a live `grep -rn <pat>
  <file>` chained after `cd` with `&&` was rewritten to `cd ... && rtk
  grep -rn <pat> <file>` (only the grep side changed); `echo hello` was
  left unchanged, confirming the whitelist/no-rewrite path is not a
  pass-through bug.
@ismoss

ismoss commented Nov 2, 2026

Copy link
Copy Markdown

Read through the plugin and it matches the design this thread converged on, so no design concerns from me — it is the right seam and the right guard. Three small things from running the same approach against dsh 0.2.1-rc.3 on Windows for a few days, take or leave:

  1. Every shell command pays for a spawn. apply calls rtk rewrite before the whitelist has seen anything, so ls, echo, Get-ChildItem and the rest of the never-rewritable majority each wait out a process launch (measured 5–20 ms here). A cheap first-token check against commands before spawning, or a small result cache, removes that for most traffic; the whitelist already tells you which heads can ever succeed.
  2. Double install is possible and invisible. Anyone already running a dsh-side rewrite plugin (mine was mounted as dsh-rtk in the same profile) gets both wrappers on ctx.shell.execute: two rtk rewrite spawns per command and a second wrap of an already-rtk command. The token gate makes the result correct, so it fails silently rather than loudly — worth a line in the uninstall section telling people to remove the older plugin first.
  3. A silent no-op is hard to diagnose. When the plugin does not load (missing ctx.shell, config error, wrong profile), nothing observable changes: commands still run, just unrewritten. Writing a small marker on every apply (mine is ~/.dsh/rtk/applied.json, holding timestamp, pid and resolved config) makes "is it actually mounted, and which process mounted it" a one-file answer. It saved me an hour of guessing once.

@nrenvo

nrenvo commented Nov 2, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for the thoughtful feedback and the Windows testing! I've added a conservative fast path for simple commands to avoid unnecessary rtk rewrite spawns.

@ismoss

ismoss commented Nov 6, 2026

Copy link
Copy Markdown

A concrete failure mode in the installer, from a week of running the same design on Windows — worth fixing before this ships, because it fails silently.

Writing the package into <profile>/node_modules/rtk-rewrite/ is not durable. That node_modules is pnpm-managed, and pnpm treats any directory not declared in the profile's package.json as extraneous: on the next pnpm install (which the dsh app runs itself on profile updates) it moves the directory into node_modules/.ignored/rtk-rewrite/. The insert entry in cordis.patch.yml is left behind, so every subsequent start reports Cannot find package 'rtk-rewrite', the plugin does not mount, and commands run unrewritten with no other visible symptom — the user just quietly stops saving tokens.

That is not hypothetical: it happened to my equivalent package today (2026-11-06) on dsh 0.2.1-rc.3 / Windows. node_modules/dsh-rtk → node_modules/.ignored/dsh-rtk, timestamped by the pnpm run, while cordis.patch.yml still had - insert: id: dsh-rtk.

What made it stick: declare it as a dependency of the profile instead of copying it, which is also how the other locally-developed plugins in a profile are mounted:

"dependencies": {
  "rtk-rewrite": "link:C:/Users/<user>/.dsh/plugins/rtk-rewrite"
}

then pnpm install in the profile (or, when a running dsh holds node_modules locked — ERR_PNPM_PACKAGE_MANAGER_REMOVE_MODULES_DIR, access denied on Windows — pnpm install --lockfile-only plus creating the node_modules/rtk-rewrite junction by hand, which pnpm then adopts). The insert entry in cordis.patch.yml stays as it is; it is orthogonal to how the package arrives.

Two follow-ups this implies:

  • rtk init -g --agent dsh --uninstall has to remove the dsh-rtk/rtk-rewrite dependency from package.json and re-run pnpm install, not just delete the directory and the patch entry.
  • a health check that distinguishes "mounted but silently pruned" from "working" would pay for itself: resolve the package from the profile and assert it is not under .ignored, and treat a missing apply marker as the failure it is.

@Aayushyaash

Copy link
Copy Markdown
Contributor

AGENTS.md can be much leaner, since rtk-rewrite already handles command rewriting, there is no need to repeat rtk usage instructions there. It only needs to tell the agent how to bypass rtk (using rtk proxy <cmd>) when raw, complete output is needed or when condensed output looks garbled.

@KuSh KuSh left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Round 1 of 3 — CHANGES REQUESTED

Claim: rtk init [-g] --agent dsh adds the RTK block to AGENTS.md (project or $DSH_HOME), and with -g installs a cordis plugin into every DSH profile that rewrites ctx.shell commands through rtk rewrite.
Scope: accept if narrowed to "rtk init [-g] --agent dsh [--uninstall] manages the RTK block in ./AGENTS.md or $DSH_HOME/AGENTS.md" (round 1, frozen). The plugin moves to #5343 with the rows measured below: on a stock DSH 0.2.2-rc.5 profile it stops DSH from starting, and pnpm ≥ 11 removes it on the next plugin install. That is more than one round can verify. #3934 makes the same narrowed claim on a layout that no longer merges, so this PR is the one to keep. Maintainer PRs: checked against #4653, #3875, #4458 and #5100; all merge clean with develop + this PR.
Ran: real DSH 0.2.2-rc.5 in Docker, driven through a mock OpenAI endpoint. 8 tool-call commands with the plugin and without it; install, HMR, uninstall and fail-open; plugin durability across dsh plugin add and pnpm install with pnpm 10, 11 and 12. rtk init local, -g, --dry-run, repeat and --uninstall on head vs merge-base. rtk rewrite and rtk hook check --agent dsh on 25 commands; the missing-hook warning with and without this PR. Invariants: non-default targets ($DSH_HOME, two profiles, CRLF and comment-tail patch files), under the hook, every decision. Savings n/a: no filter added.
Pins: Rust: 22 decisions mutated, 7 survived. JS plugin: 30 mutated, 11 survived (4 of them equivalent on real rtk rewrite output). The survivors inside the narrowed claim are listed under item 2; the rest went into #5343.
Matrix: executed this round; pin check: executed this round
CI @8e6b3bc1: all green. Locally, develop + this PR: fmt, clippy, 5986 tests pass.

Blocks merge (2, frozen at round 1)

  1. src/hooks/hook_check.rs:29 — a rules-file install counted as an active hook. dsh::is_configured returns true for any ./AGENTS.md that carries the RTK block. rtk init --agent kimi writes the same block, and is_any_agent_configured() suppresses Claude Code's missing-hook warning. So a Claude Code user without the hook, working in a project where Kimi or DSH instructions were installed, no longer sees [rtk] /!\ No hook installed. On develop the warning prints (same HOME with ~/.claude and no hook, same project, rtk git status): [rtk] /!\ No hook installed — run rtk init -g …. With this PR, nothing. Kimi, Kilo Code and Cline are rules-file agents and none of them is in AGENT_PROBES. Must satisfy: that row prints the warning again, and a test pins it.
  2. src/lib.rs:2395 and src/lib.rs:3102 — unpinned behaviour (-g routing). Evidence: uninstall_dsh(global, …) → uninstall_dsh(false, …) passes 4628/4628, and so does run_dsh_mode(global, …) → run_dsh_mode(false, …). The dsh.rs tests call the *_at helpers with a path, so nothing checks that -g reaches $DSH_HOME. Test must: run rtk init -g --agent dsh, then rtk init -g --agent dsh --uninstall, with DSH_HOME=<scratch> and the current directory set to another scratch dir. Install writes <DSH_HOME>/AGENTS.md and leaves the current directory untouched; uninstall removes the block from <DSH_HOME>/AGENTS.md. Both mutations must turn it red.

Filed as follow-ups

  • #5343 DSH: rewrite commands through a cordis plugin — cut by the narrowed claim. It carries:
    • the boot failure: append_dsh_patch appends block YAML after the [] that DSH ships, and DSH then exits on failed to parse overlay …/cordis.patch.yml: YAMLException … (6:1);
    • the pnpm ≥ 11 pruning: the plugin goes to .ignored/ or is deleted, the patch entry stays, DSH logs Cannot find package 'rtk-rewrite', and rerunning init reports success;
    • rtk hook check --agent dsh disagreeing with the plugin on 3 of 5 commands;
    • the surviving mutations.

Checked and correct — no need to re-verify

  • The AGENTS.md block, local and -g: created when the file is missing; user content kept; repeat is a no-op; --dry-run writes nothing; uninstall removes exactly the block.
  • $DSH_HOME takes precedence over ~/.dsh.
  • A local install touches no profile.
  • dsh as RulesOnly in decision.rs matches the narrowed claim.
  • Moving print_instructions_agents_awareness_note to init/mod.rs changes no output.
  • The CI matrix is green, and develop + this PR passes fmt, clippy and the full suite.

Your questions

  • "I left DSH out of engine/src/harness.rs … Happy to add one if you'd rather have the consistency." → Drop it. After the narrowing nothing hook-shaped is installed, so leaving the row out is the accurate profile.

Next

To merge: the narrowed claim (drop the plugin, hooks/dsh/, the profile code and the plugin parts of the README), plus items 1 and 2. The plugin work and the rows it has to pass are in #5343.
Rounds: 1/3. Threads: 2 open (waiting on the author), 0 resolved this round.

Comment thread src/hooks/hook_check.rs Outdated
super::init::opencode::is_configured,
super::init::codex::is_configured,
super::init::droid::is_configured,
super::init::dsh::is_configured,

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Item 1: this probe counts any local AGENTS.md that carries the RTK block as an active hook. rtk init --agent kimi writes the same block, so in such a project Claude Code's [rtk] /!\ No hook installed warning no longer prints (it does on develop). Kimi, Kilo Code and Cline are rules-file agents and none of them is in AGENT_PROBES. Must satisfy: with ~/.claude present and no hook, rtk git status in a project whose AGENTS.md has the RTK block prints the warning again, and a test pins it.

Comment thread src/lib.rs
hooks::init::uninstall_vibe(ctx)?;
Ok(0)
} else if agent == Some(AgentTarget::Dsh) {
hooks::init::uninstall_dsh(global, ctx)?;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Item 2: uninstall_dsh(global, ctx) → uninstall_dsh(false, ctx) passes 4628/4628. A test that runs rtk init -g --agent dsh --uninstall with DSH_HOME=<scratch> and the current directory set to another scratch dir must assert the block is removed from <DSH_HOME>/AGENTS.md, and this mutation must turn it red.

Comment thread src/lib.rs
} else if agent == Some(AgentTarget::Vibe) {
hooks::init::run_vibe_mode(global, hook_only, patch_mode, ctx)?;
} else if agent == Some(AgentTarget::Dsh) {
hooks::init::run_dsh_mode(global, ctx)?;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Item 2: run_dsh_mode(global, ctx) → run_dsh_mode(false, ctx) passes 4628/4628; the dsh.rs tests call the *_at helpers with a path. A test that runs rtk init -g --agent dsh with DSH_HOME=<scratch> and the current directory set to another scratch dir must assert <DSH_HOME>/AGENTS.md gets the block and the current directory stays untouched, and this mutation must turn it red.

…_PROBES/global-routing coverage

Round 1 review on rtk-ai#4809 (KuSh) asked to narrow this PR to "rtk init [-g]
--agent dsh [--uninstall] manages the RTK block in AGENTS.md" and move the
cordis plugin (hooks/dsh/rtk-rewrite/) to a follow-up issue: on a stock DSH
profile it fails to parse and pnpm >= 11 prunes it silently, more than one
round can verify.

- Drop the plugin install/uninstall code, hooks/dsh/rtk-rewrite/, and the
  plugin parts of hooks/dsh/README.md and hooks/README.md.
- Remove dsh::is_configured from AGENT_PROBES: it only checks for the
  shared AGENTS.md marker block, which Kimi/Kilo Code/Cline also write, so
  it could silence a Claude Code user's missing-hook warning in a project
  that only has one of those rules-file agents configured. Kimi etc. were
  never probed for the same reason; DSH now follows the same precedent.
  Added a hook_check test pinning that a Kimi or DSH block alone does not
  suppress the warning.
- Added an integration test pinning rtk init -g --agent dsh's routing to
  $DSH_HOME (and its uninstall counterpart), since the existing dsh.rs unit
  tests only exercise the *_at helpers directly and never the global
  branch's own home resolution.
@nrenvo

nrenvo commented Nov 29, 2026

Copy link
Copy Markdown
Contributor Author

Round 1 of 3 — CHANGES REQUESTED

Claim: rtk init [-g] --agent dsh adds the RTK block to AGENTS.md (project or $DSH_HOME), and with -g installs a cordis plugin into every DSH profile that rewrites ctx.shell commands through rtk rewrite. Scope: accept if narrowed to "rtk init [-g] --agent dsh [--uninstall] manages the RTK block in ./AGENTS.md or $DSH_HOME/AGENTS.md" (round 1, frozen). The plugin moves to #5343 with the rows measured below: on a stock DSH 0.2.2-rc.5 profile it stops DSH from starting, and pnpm ≥ 11 removes it on the next plugin install. That is more than one round can verify. #3934 makes the same narrowed claim on a layout that no longer merges, so this PR is the one to keep. Maintainer PRs: checked against #4653, #3875, #4458 and #5100; all merge clean with develop + this PR. Ran: real DSH 0.2.2-rc.5 in Docker, driven through a mock OpenAI endpoint. 8 tool-call commands with the plugin and without it; install, HMR, uninstall and fail-open; plugin durability across dsh plugin add and pnpm install with pnpm 10, 11 and 12. rtk init local, -g, --dry-run, repeat and --uninstall on head vs merge-base. rtk rewrite and rtk hook check --agent dsh on 25 commands; the missing-hook warning with and without this PR. Invariants: non-default targets ($DSH_HOME, two profiles, CRLF and comment-tail patch files), under the hook, every decision. Savings n/a: no filter added. Pins: Rust: 22 decisions mutated, 7 survived. JS plugin: 30 mutated, 11 survived (4 of them equivalent on real rtk rewrite output). The survivors inside the narrowed claim are listed under item 2; the rest went into #5343. Matrix: executed this round; pin check: executed this round CI @8e6b3bc1: all green. Locally, develop + this PR: fmt, clippy, 5986 tests pass.

Blocks merge (2, frozen at round 1)

  1. src/hooks/hook_check.rs:29 — a rules-file install counted as an active hook. dsh::is_configured returns true for any ./AGENTS.md that carries the RTK block. rtk init --agent kimi writes the same block, and is_any_agent_configured() suppresses Claude Code's missing-hook warning. So a Claude Code user without the hook, working in a project where Kimi or DSH instructions were installed, no longer sees [rtk] /!\ No hook installed. On develop the warning prints (same HOME with ~/.claude and no hook, same project, rtk git status): [rtk] /!\ No hook installed — run rtk init -g …. With this PR, nothing. Kimi, Kilo Code and Cline are rules-file agents and none of them is in AGENT_PROBES. Must satisfy: that row prints the warning again, and a test pins it.
  2. src/lib.rs:2395 and src/lib.rs:3102 — unpinned behaviour (-g routing). Evidence: uninstall_dsh(global, …) → uninstall_dsh(false, …) passes 4628/4628, and so does run_dsh_mode(global, …) → run_dsh_mode(false, …). The dsh.rs tests call the *_at helpers with a path, so nothing checks that -g reaches $DSH_HOME. Test must: run rtk init -g --agent dsh, then rtk init -g --agent dsh --uninstall, with DSH_HOME=<scratch> and the current directory set to another scratch dir. Install writes <DSH_HOME>/AGENTS.md and leaves the current directory untouched; uninstall removes the block from <DSH_HOME>/AGENTS.md. Both mutations must turn it red.

Filed as follow-ups

  • DSH: rewrite commands through a cordis plugin (follow-up to #4809) #5343 DSH: rewrite commands through a cordis plugin — cut by the narrowed claim. It carries:

    • the boot failure: append_dsh_patch appends block YAML after the [] that DSH ships, and DSH then exits on failed to parse overlay …/cordis.patch.yml: YAMLException … (6:1);
    • the pnpm ≥ 11 pruning: the plugin goes to .ignored/ or is deleted, the patch entry stays, DSH logs Cannot find package 'rtk-rewrite', and rerunning init reports success;
    • rtk hook check --agent dsh disagreeing with the plugin on 3 of 5 commands;
    • the surviving mutations.

Checked and correct — no need to re-verify

  • The AGENTS.md block, local and -g: created when the file is missing; user content kept; repeat is a no-op; --dry-run writes nothing; uninstall removes exactly the block.
  • $DSH_HOME takes precedence over ~/.dsh.
  • A local install touches no profile.
  • dsh as RulesOnly in decision.rs matches the narrowed claim.
  • Moving print_instructions_agents_awareness_note to init/mod.rs changes no output.
  • The CI matrix is green, and develop + this PR passes fmt, clippy and the full suite.

Your questions

  • "I left DSH out of engine/src/harness.rs … Happy to add one if you'd rather have the consistency." → Drop it. After the narrowing nothing hook-shaped is installed, so leaving the row out is the accurate profile.

Next

To merge: the narrowed claim (drop the plugin, hooks/dsh/, the profile code and the plugin parts of the README), plus items 1 and 2. The plugin work and the rows it has to pass are in #5343. Rounds: 1/3. Threads: 2 open (waiting on the author), 0 resolved this round.

Pushed — dropped the plugin per your call (filed as #5343), dropped dsh::is_configured from AGENT_PROBES, and pinned both gaps with tests (Kimi/DSH suppression + -g routing). Thanks for the thorough round 1, let me know if anything's still off!

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

FR: Support DSH (DeepSeek Harness)

4 participants