piagent_
← /news
Aug 23, 2026community

dsh-pi-agent: run pi's loop inside DeepSeek Harness's web UI via --mode rpc

On 2026-08-23, Micheleww published dsh-pi-agent in the earendil-works/pi Discussions as the first community plugin to wire pi into DeepSeek Harness (DSH) using the --mode rpc headless interface. DSH is a plugin-based platform with a web UI, durable SQLite-backed sessions, hooks, presets, and an approval chain; pi is a minimal harness with a roughly 300-token system prompt and four tools (read/bash/edit/write). The plugin sits between them and gives the user both at once: DSH’s engineering shell around pi’s clean engine.

The integration works by registering an AgentFactory on DSH’s ctx.agents. Every DSH session is then driven by a headless pi --mode rpc child process over JSONL on stdio — the plugin spawns the child with --session <file> when a saved session exists, and with --no-session for ephemeral invocations (such as the mid-session handoff path). On create/resume the plugin rebuilds a pi session file from DSH’s durable event log and launches the child with --session, so the child starts with full conversation history — including turns that ran under DSH’s own loop before the switch was enabled. Commands map cleanly: set_model is per-session, send(..., "next-turn") becomes pi’s steer, and abort works through the same channel. Pi’s local-trust model applies — pi tool calls do not pass through DSH’s approval chain, because the model is talking to pi, not to DSH.

The plugin also ships a SubagentProvider row so tool-subagent with provider: pi spawns fresh pi -p <task> processes per delegation. The two rows are independent: you can run a pi main loop with native DSH subagents, a native main loop with pi subagents, or both at once. Micheleww verifies the integration end-to-end against DSH 0.1.x — session create/resume, streaming turns, steering, subagent delegation, and native↔pi fallback — and ships the plugin under MIT. The repo notes that an npm package (dsh-pi-agent v0.2.0) is planned.

For Piagent readers, dsh-pi-agent is the clearest external validation of --mode rpc as an integration surface — the same channel that the official subagent example extension uses to drive child pi processes. It also inverts the earlier pi2dsh integration pattern (where the wrapper ran pi as a DeepSeek-focused harness): here DSH runs pi as its agent loop, while keeping its own web UI and frontend. The two projects together show how the same surface area — --mode rpc plus the headless child — accommodates both directions.

source: https://github.com/earendil-works/pi/discussions/8508