Skip to content

Add DSH (DeepSeek Harness) as an instructions-only install target - #1608

Open
yangwuan55 wants to merge 1 commit into
colbymchenry:mainfrom
yangwuan55:feat/dsh-agent-target
Open

Add DSH (DeepSeek Harness) as an instructions-only install target#1608
yangwuan55 wants to merge 1 commit into
colbymchenry:mainfrom
yangwuan55:feat/dsh-agent-target

Conversation

@yangwuan55

Copy link
Copy Markdown

What

Adds dsh as a new installer target for DSH (DeepSeek Harness), alongside claude / cursor / codex / opencode / hermes / gemini / antigravity / kiro / copilot-*.

codegraph install -t dsh            # or pick DSH in the interactive prompt

DSH agents have no MCP client. Instead they ingest plain-markdown instruction files and re-digest them every turn:

  • local → <project-root>/AGENTS.md
  • global → $DSH_HOME/AGENTS.md (defaults to ~/.dsh/AGENTS.md)

So this target is instructions-only: it writes the existing marker-fenced CodeGraph usage block (instructions-template.ts) and nothing else — no MCP server config anywhere. The agent drives codegraph explore / other subcommands through its shell tool, which prints the same output as the MCP tools. That is precisely the "non-MCP harness" audience the instructions block was reintroduced for in #704.

Why a new interface knob

AgentTarget grows one optional field:

/** Defaults to true; all existing targets are unchanged. */
readonly requiresRestart?: boolean;

DSH sets it to false because running sessions re-read their instructions file each turn — so the install/uninstall summaries now say "no restart needed" when every touched target is restart-free, instead of asking users to restart for nothing. Every existing target keeps today's behavior.

Details

  • New file src/installer/targets/dsh.ts + registry entry + 'dsh' in the TargetId union; nothing else about the target system changes.
  • Uninstall strips only the marker block and preserves surrounding user content; a block-only AGENTS.md is deleted entirely, matching removeMarkedSection semantics.
  • Test-hygiene fix surfaced while testing on a machine that actually runs DSH: setHome() now clears $DSH_HOME at setup, not only at restore — otherwise an ambient value leaks the real ~/.dsh into every supposedly-isolated test.
  • README badges + supported-agents list, CLI help text, CHANGELOG entry under Unreleased.
  • No docsUrl claimed (didn't want to invent a URL; happy to add one if there's a canonical link.

Verification

RUN v2.1.9 /private/tmp/codegraph-pr

tests/installer.test.ts (3 tests) 4ms
tests/installer-targets.test.ts (244 tests | 3 skipped) 314ms

Test Files 2 passed (2)
Tests 244 passed | 3 skipped (247)
Start at 15:15:05
Duration 672ms (transform 159ms, setup 0ms, collect 245ms, tests 319ms, environment 0ms, prepare 114ms) → 244 passed, 3 skipped (pre-existing skips), including the generic per-target contract suite exercising at both locations (install / idempotency / uninstall-reverses / printConfig-no-writes), plus dedicated tests: override, sibling-content preservation across install/uninstall, no-MCP printConfig.

  • clean.
  • End-to-end sandbox run (redirected HOME/DSH_HOME): at both locations, byte-identical re-run, uninstall round-trip, mixed install still asking for a restart, unknown-target error now listing .

Happy to adjust naming () or scope — e.g. splitting the orchestrator message tweak into its own PR if reviewers prefer.
EOF
)

DSH agents have no MCP client; they pick up plain-markdown instruction
files every turn instead. The new `dsh` target therefore writes only the
marker-fenced CodeGraph usage block — into `<project>/AGENTS.md` (local)
or `$DSH_HOME/AGENTS.md` (global, defaulting to `~/.dsh/AGENTS.md`) —
and no MCP server config. The agent drives the `codegraph` CLI via its
shell tool, which prints the same output as the MCP tools; this is
exactly the non-MCP-harness audience the instructions block was
reintroduced for in colbymchenry#704.

Details:

- `AgentTarget` grows an optional `requiresRestart` flag (default true,
  all existing targets unchanged). DSH sets false because running
  sessions re-digest their instructions file each turn, so the
  install/uninstall summaries say "no restart needed" instead of asking
  for a pointless restart.
- Uninstall strips only the marker block and preserves surrounding user
  content; a block-only AGENTS.md is removed entirely, matching shared
  semantics.
- `setHome()` in the target tests now clears `$DSH_HOME` at setup, not
  just at restore — an ambient value would leak the real `~/.dsh` into
  every otherwise-isolated test.
- README badges/lists, CLI help text, and a CHANGELOG entry.

Verified: full installer-target contract suite passes for dsh at both
locations (install/idempotency/uninstall/printConfig), plus dedicated
tests for $DSH_HOME override, sibling-content preservation, and the
no-MCP printConfig; tsc --noEmit clean; end-to-end sandbox run of
`codegraph install -y -t dsh` / `uninstall` round-trips both locations.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant