You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
dsh-pi-agent — run the Pi loop inside DeepSeek Harness (DSH), with DSH's web UI
I built a plugin that swaps DeepSeek Harness's agent loop for pi — while keeping DSH's web frontend, session persistence, and hooks fully intact. The subagent engine can also be switched to pi independently (each delegation spawns pi -p in the parent session's cwd, like DSH's own claude-code/codex bridges).
DSH web frontend (sessions, hooks, presets, SQLite persistence, UI)
│
dsh-pi-agent (AgentFactory + event translation)
│ spawn + JSONL over stdio: set_model / prompt / steer / abort
▼
pi --mode rpc --no-session (the pi agent loop, untouched)
Main loop: the plugin registers an AgentFactory on ctx.agents, so every session the frontend creates is driven by a headless pi --mode rpc child. DSH's agent-loop stays registered underneath — disable one row, enable the other, restart, done.
Subagents: a separate SubagentProvider row; tool-subagent with provider: pi makes each delegation a fresh pi -p <task> process. provider: spawn switches back to DSH-native children. The two rows are independent — pi main + native subs, native main + pi subs, or both.
Zero prompt collision: the pi child owns its entire context (its own system prompt, tools, AGENTS.md discovery). DSH's prompt assembly and tool surface never reach the model in pi-driven sessions, and vice versa.
Why
Pi's minimal loop (~300-token prompt, four tools, no mid-session injections) is a great engine; DSH is a great shell (durable sessions, web UI, presets, hooks, approval chains). This plugin is both at once — and it makes a clean A/B experiment: same frontend, same session format, flip one config row to compare DSH's native loop against bare pi on the same task.
The integration surfaces pi already provides (--mode rpc JSONL protocol, -p print mode) do all the work — no pi internals were forked or modified.
Status
Working end-to-end against DSH 0.1.x: session create/resume, streaming turns, steering, subagent delegation, and native↔pi fallback all verified. It will be on npm as dsh-pi-agent (v0.2.0, publishing shortly).
Happy to share the profile config for anyone who wants to try it — and feedback on the factory/provider seam usage is very welcome.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
dsh-pi-agent — run the Pi loop inside DeepSeek Harness (DSH), with DSH's web UI
I built a plugin that swaps DeepSeek Harness's agent loop for pi — while keeping DSH's web frontend, session persistence, and hooks fully intact. The subagent engine can also be switched to pi independently (each delegation spawns
pi -pin the parent session's cwd, like DSH's own claude-code/codex bridges).Repo: https://github.com/Micheleww/dsh-pi-agent (MIT, TypeScript)
How it works
AgentFactoryonctx.agents, so every session the frontend creates is driven by a headlesspi --mode rpcchild. DSH'sagent-loopstays registered underneath — disable one row, enable the other, restart, done.SubagentProviderrow;tool-subagentwithprovider: pimakes each delegation a freshpi -p <task>process.provider: spawnswitches back to DSH-native children. The two rows are independent — pi main + native subs, native main + pi subs, or both.AGENTS.mddiscovery). DSH's prompt assembly and tool surface never reach the model in pi-driven sessions, and vice versa.Why
Pi's minimal loop (~300-token prompt, four tools, no mid-session injections) is a great engine; DSH is a great shell (durable sessions, web UI, presets, hooks, approval chains). This plugin is both at once — and it makes a clean A/B experiment: same frontend, same session format, flip one config row to compare DSH's native loop against bare pi on the same task.
The integration surfaces pi already provides (
--mode rpcJSONL protocol,-pprint mode) do all the work — no pi internals were forked or modified.Status
Working end-to-end against DSH 0.1.x: session create/resume, streaming turns, steering, subagent delegation, and native↔pi fallback all verified. It will be on npm as
dsh-pi-agent(v0.2.0, publishing shortly).Happy to share the profile config for anyone who wants to try it — and feedback on the factory/provider seam usage is very welcome.
All reactions