$ cat ~/map/dsh-pi-agent.md
dsh-pi-agent
DeepSeek Harness (DSH) AgentFactory that swaps DSH's native agent loop for a headless pi --mode rpc child, so DSH's web UI, sessions, hooks, and presets keep working with pi's minimal prompt and four tools.
extensions✓ Oct 16
Facts
- repository
- github.com/Micheleww/dsh-pi-agent ↗
- GitHub Stars
- ★ 2
- Forks
- 0
- license
- MIT
- npm / mo
- —
- last push
- Aug 23, 2026
install
npm install dsh-pi-agent## TL;DR
DeepSeek Harness plugin that runs pi as the agent loop: a headless pi --mode rpc child process per session, so DSH's web UI, session log, hooks, and presets keep working while the model sees only pi's minimal prompt and four tools.
## Key points
- $Registers a DSH AgentFactory that spawns a headless pi --mode rpc child process speaking JSONL over stdio, with set_model / prompt / steer / abort commands — DSH's frontend (session log, hooks, presets, web UI) works unchanged.
- $The model sees exactly what it would see running pi directly in the same working directory: pi keeps its ~300-token system prompt and four tools (read/bash/edit/write), and DSH's own prompt assembly and tool surface are bypassed entirely for these sessions.
- $Mid-session handoff: on every create/resume the plugin rebuilds a pi session file from DSH's durable event log, so the child starts with the full conversation including turns that ran under DSH's own loop; rebuilt files land under ~/.dsh/pi-sessions/<session-id>.jsonl for audit. Image blocks are currently skipped.
- $Steering: DSH send(..., 'next-turn' | 'next-step') maps to pi's steer to inject instructions mid-run; a delegated subagent's requested model wins over the factory default.
- $Subagents run as an independent profile row: each delegation spawns a fresh pi -p <task> in the parent's working directory with its own AGENTS.md discovery, inheritsParentContext: false — nothing from the parent conversation crosses the process boundary.
- $Requirements: Node.js >= 20, pi on PATH (or the piPath config key), and DSH with a profile exposing sessions and agents services. Config keys: piPath, cwd, model, debug (appends protocol diagnostics to /tmp/dsh-pi-agent.log).
## FAQ
Q Do pi tool calls go through DSH's approval chain?
No — pi's local-trust model applies, and pi tool calls never pass through DSH's approval chain. Disabling this plugin's entry makes DSH's own dsh-agent-loop active again immediately.
Q How do I debug it?
Set debug: true in the mount config (or mount with a logger): every RPC command, event, child-process exit, and factory lifecycle step is appended to /tmp/dsh-pi-agent.log, with pi's own stderr forwarded into the same log.
## References
## Related entries
$ pi2dsh
Compatibility bridge that lets DeepSeek Harness run unmodified pi ecosystem packages by mapping pi's public extension ABI onto DSH native services.
$ pi-acp-jetbrain
Agent Client Protocol adapter that runs pi inside JetBrains IntelliJ's agent panel over stdio, with one pi --mode rpc subprocess per session.
$ pi-librenms
LibreNMS network-monitoring tools for pi: devices, ports, alerts, and Oxidized configs over the REST API, no MCP layer.
Last updated: Aug 31, 2026