<!-- Source: https://console.uubright.com/docs/deepseek/ -->
# DeepSeek Harness ACP host experiment

This is a host-only, opt-in runtime for one direct task. Once configured, **DeepSeek Harness** appears in New Task's Agent picker for the Default workspace; Claude Code remains the default. The task still uses the runner's durable inbox and acknowledged event link, task worktree, approval cards, and Open PR handoff. The Harness itself is a separate host installation; `ccr-cloud` has no Harness npm dependency or DSH plugin integration.

## Pinned upstream contract

The adapter targets upstream tag [`dsh-v0.2.2-rc.3`](https://github.com/deepseek-ai/deepseek-harness/tree/dsh-v0.2.2-rc.3), exact commit `38a6a5c965aa99ab525161efb7cc5cf1fe62fced` and `@deepseek-ai/dsh-acp-app` version `0.2.2-rc.3`. Its [ACP package contract](https://github.com/deepseek-ai/deepseek-harness/blob/38a6a5c965aa99ab525161efb7cc5cf1fe62fced/packages/acp/acp/README.md) and [ACP profile contract](https://github.com/deepseek-ai/deepseek-harness/blob/38a6a5c965aa99ab525161efb7cc5cf1fe62fced/packages/bundle/acp-app/README.md) specify newline-delimited JSON-RPC stdio, `initialize`, `session/new`, `session/prompt`, `session/request_permission`, `session/update`, `session/cancel`, and `session/resume`. Resume restores context without replaying prior output. The adapter requires ACP v1 and advertised resume support, then saves the session ID in the runner's state for Stop/Resume. It passes each task's own absolute workspace and runner MCP servers into new and resumed sessions.

Install that exact tag separately as the server user and configure model credentials in its host profile, following upstream's build instructions. The tag's root requires Node 24.9+ and pnpm 11.28.5; a host running uuBright on Node 22 must supply a separately pinned Node 24 or an official packaged executable for `dsh`.

The current acceptance host has npm `dsh` 0.2.2-rc.3 at `/home/ubuntu/.local/opt/uubright-dsh-0.2.2-rc.3/node_modules/.bin/dsh`. It uses Node 24.16.0 from the separate rc.1 prefix: prepend `/home/ubuntu/.local/opt/uubright-dsh-0.2.2-rc.1/node_modules/node/bin` to `PATH`, then set `DEEPSEEK_BIN` to that rc.3 executable's absolute path. Set `DSH_HOME` to an **absolute, separate, host-owned profile directory outside the task worktree**. The shipped rc.3 ACP profile selects `deepseek-official`, whose default credential reference is the host process's `DEEPSEEK_API_KEY`; an empty profile and a successful ACP handshake do not supply that key.

On this host, the acceptance profile is `/mnt/data/tmp/uubright-dsh-acceptance-20261117` (directory mode `0700`). Put the key in that profile's `.env` as `DEEPSEEK_API_KEY=…` using a private editor or secret manager, then set the file mode to `0600`; a host process environment variable with the same name also works. Never put the key in a task prompt, repository, command argument, or Console setting. Do not source or print the profile file. The New Task choice appears only when the experiment flag is set, the executable is present, `DSH_HOME` is absolute, and the key is available from the host environment or that profile file. This availability check does not make a model request.

Set `CCR_CLOUD_ENABLE_DEEPSEEK_EXPERIMENT=1` only for disposable acceptance. The executable must preserve the task workspace as its process working directory. Creation and Resume require the executable, flag, isolated profile, and default profile credential. Confirm the executable comes from the pinned checkout or package; the setting alone cannot prove provenance. The host's Harness profile and model credentials stay on the host. ACP `authenticate` succeeds without its own credential check, so a successful handshake does **not** prove model access. Verify an actual model turn before acceptance. Do not place provider credentials in the task request or repository. The runner starts `DEEPSEEK_BIN --profile acp` with `DSH_PERMISSION_MODE=workspace-write` to retain the profile's ask policy even if the host environment requests a broader mode.

On the acceptance host, the installed npm rc.3 package with Node 24.16.0 completed real ACP `session/new`, process restart, and `session/resume` with the same session ID using disposable state and workspace directories. A keyless `session/prompt` returned `llm-deepseek: no API key for provider route "deepseek-official"`; the adapter left that turn uncertain for owner recovery. Manager later observed credentialed model turns, one human deny and one one-shot allow, Stop/Resume of the same Console task and ACP session, and fixture issue #1 becoming a review-ready PR. These observations covered an earlier code head; repeat them after changes to the adapter. A source comparison of the exact rc.1 and rc.3 tags found no change to the ACP method or permission-choice surface used here; rc.3 improves prompt settlement by waiting on the whole nested subagent tree rather than direct child agents alone.

Create a task through the owner API with `experimentalRuntime`:

```json
{
  "agent": "claude",
  "experimentalRuntime": "deepseek-harness",
  "permissionMode": "default",
  "modelRoute": "account",
  "repo": "OWNER/REPO",
  "prompt": "Implement the requested change"
}
```

The `agent: "claude"` field is the legacy task selector used by the current server schema; the separate `experimentalRuntime` field is authoritative for execution and is visible on the task record. The New Task picker adds this marker automatically when DeepSeek is selected, while the runner emits agent events labeled `deepseek`. This narrow route does not extend the general agent selector for Managers or other task types.

Only direct host tasks in the Default workspace are accepted. **Ask** is the only permission mode; Auto, Bypass, plan mode, and Allow for this task are unavailable because this ACP profile offers one-shot allow/reject only. Docker, This Mac, reviewers, Managers/workers, chat, rooms, plugins, browser help, external-session continuation, model selection or switching, and response styles fail at creation or are unavailable in the runtime. ACP modes, commands, plans, and client filesystem operations are not offered. File attachments are delivered as workspace paths in the prompt; inline image prompts are not supported. ACP reports committed text and generic tool lifecycle but no transcript replay, usage accounting, or detailed provider failures. A stopped turn remains uncertain under the runner's normal inbox rule and requires the owner's resend or dismiss decision. The ordinary runner Open PR command remains available after the task changes files.

The experiment supports the shipped `deepseek-official` profile and its `DEEPSEEK_API_KEY` credential. Custom Harness profiles, provider routes, and credentials are outside this acceptance scope; the Console redactor does not know their secret names. Do not configure them for this route.

A **human denial** follows a displayed approval request and is recorded as a deny decision for that one tool call. A **Harness runtime block** can fail a tool before a request is sent; Console then shows a tool failure without an approval card. The approval controls cannot override that block, and neither outcome grants task-wide permission. ACP requests without the active session ID or a prior displayed tool call are cancelled instead of shown as approvable requests.

The subprocess starts with the task worktree as its working directory. Its environment is limited to host profile/model, Git identity and credential, proxy, and basic process variables; it does not inherit arbitrary runner variables such as `NODE_OPTIONS`. ACP receives only the runner-owned `ccr-task` and `ccr-artifacts` stdio shims with their local socket paths. Repository `.mcp.json` files and repository-provided MCP commands or environment entries are not passed to ACP. The Harness client is trusted by its profile, so confirm the profile and host account before enabling this route.

Before acceptance on a host, verify the pinned binary and authentication, start a disposable scratch task, exercise one allow and one deny approval, stop during a prompt and inspect the uncertain-message recovery, resume the saved ACP session, and open a draft PR from a disposable worktree. The Manager owns that host acceptance; this branch does not run a production service.
