Introduction¶
DeepSeek Harness (DSH) extends its capabilities through plugins, allowing external services to be exposed as tools callable by the model. In coding agent scenarios, a common need is to invoke a pre-configured coding agent within a DSH session to carry out specific tasks, while reusing the agent’s own credentials and skill configuration. dsh-pi-acp was built to fulfill exactly this need: it bridges the pi coding agent into DSH and provides capabilities such as background execution, session management, and a dedicated settings page.
What It Is¶
dsh-pi-acp is a DeepSeek Harness plugin maintained by zhiyu1998. It acts as a client for pi-acp (JSON-RPC 2.0 over stdio), exposing the pi coding agent’s capabilities as three model-callable tools: pi_run, pi_session, and pi_status. The tools share the same credentials, model, and skill configuration (located at ~/.pi/agent) as pi. The plugin handles establishing stdio/JSON-RPC communication between DSH and pi.
Core Features¶
The plugin provides three tools, corresponding to task execution, session management, and diagnostics, respectively.
pi_run¶
Submits a task to pi and returns the response, tool calls, token usage, elapsed time, and a session handle. Supports creating new sessions and continuing existing ones, and also supports reloading by pi’s session ID after a DSH restart.
// Start a new session (result includes session: "pi1")
{ "task": "Extract date formatting from src/utils.ts into a function", "cwd": "D:\\repo\\proj" }
// Continue the same session; pi retains context
{ "task": "Add another edge case", "session": "pi1" }
// After DSH restart, reload by pi's session ID
{ "task": "Continue", "resume": "01a1ed2c-c1b4-744a-b9af-b387a025df7e" }
pi_session¶
Manages the session lifecycle. Supports list to enumerate sessions, close to close a session, output to read progress, and wait to block until completion. Ideal for scenarios requiring multiple interactions or progress monitoring.
pi_status¶
A diagnostics entry point. Lists detected entry paths, pi-acp and pi versions, available models, and thinking levels. Useful for troubleshooting installation and configuration issues.
Installation & Activation¶
The following prerequisites must be met before use:
piis installed on PATH and logged in (npm i -g @earendil-works/pi-coding-agent).pi-acpis installed (npm i -g pi-acp).- All credentials, model, and skill settings use pi’s own configuration (
~/.pi/agent).
Install the plugin:
dsh plugin add https://github.com/zhiyu1998/dsh-pi-acp
You can also download the dsh-pi-acp-<version>.tgz file from GitHub Releases to install (automatically packaged and published by GitHub Actions when a v* tag is pushed).
After installation, restart DSH. The tool surface will show the three tools pi_run / pi_session / pi_status, and a “pi (ACP)” section will appear in the settings page.
Background Execution¶
For long-running tasks that should not occupy a turn in DSH, use the background: true parameter to immediately receive a running handle.
{ "task": "Organize the top-level Downloads folder", "cwd": "C:\\Users\\Administrator\\Downloads", "background": true }
{ "action": "output", "session": "pi1" } // Non-blocking progress check
{ "action": "wait", "session": "pi1", "waitMs": 300000 } // Block until done, get full result
You can also delegate the entire “call pi_run then wait” sequence to DSH’s subagent, so the main session only receives a summary.
Configuration¶
The plugin can be configured via the settings page or written directly into the profile’s cordis.patch.yml.
- id: pi-acp
name: 'dsh-pi-acp'
config:
model: magpie/auto/deepseek-v4.1-flash
thinking: low # off / low / medium / high / max; leave empty to follow pi
defaultCwd: 'D:\repo\proj'
timeoutMs: 600000 # Wall-clock limit per turn
maxConcurrent: 4
permission: allow # allow | deny (pi's permission prompts)
idleTimeoutMin: 15 # Idle duration before closing the pi process
Settings Page¶
The “pi (ACP)” top-level section in settings includes the following:
- Installation Detection: Displays versions of
pi-acpandpi, with a re-detect button. Data is sourced from the read-only routeGET /pi-acp/diagnose. - Default Model: “Follow pi’s own default model” is checked by default; the currently effective model is shown on the right (read from
defaultProvider/defaultModelin~/.pi/agent/settings.json). Unchecking reveals a dropdown populated from pi’s model catalog (~/.pi/agent/models.json); saving the selection overrides the default. - Thinking Level: A dropdown to select the level (Follow / off / minimal / low / medium / high / max). Levels not supported by the current model are greyed out.
- Tool Permissions:
allow/denydropdown selection. - Other Fields: Per-turn timeout, concurrent turn count, etc., using DSH’s native form fields.
Troubleshooting¶
- pi cannot execute commands on Windows: pi’s
bashmay resolve to the WSL launcher (C:\Windows\System32\bash.exe). Set"shellPath": "C:\\Program Files\\Git\\bin\\bash.exe"in~/.pi/agent/settings.json, or use"defaultTools": ["read", "powershell", "edit", "write"]instead. - Plugin is active but no
pi_*tools appear: DSH swallows the plugin’sconsole.erroroutput. Check%USERPROFILE%\pi-acp-import.log(whether the module was imported) and%USERPROFILE%\pi-acp-selftest.log(apply path and the result of each register). Common causes include usingtype: [a, b]inoutput.schema(DSH only recognizesoneOf), and probing services outside of declared endpoints (cordis will throw an error directly). - Entry resolution order: The entry file is resolved in the following order:
entryFile/DSH_PI_ACP_ENTRY/PI_ACP_ENTRY→ npm global prefix → thepi-acpshim on PATH.pi_statuslists all probed paths.
Use Cases & Notes¶
Suitable for scenarios where you need to invoke the pi coding agent directly within DSH, such as: having the model use pi’s toolchain for code refactoring, batch task processing, or continuous conversational interaction. The plugin runs with the current dsh process permissions; it is recommended to review the source code and license before installation.
Conclusion¶
dsh-pi-acp integrates the pi coding agent’s capabilities into DeepSeek Harness via ACP, providing tool invocation, session management, and background execution, and centralizes configuration of the default model, thinking level, and tool permissions on the settings page. For more information, visit the plugin directory page and the GitHub repository.