Introduction¶
DeepSeek Harness (DSH) allows only one AgentFactory to be mounted at the process level. The previous approach either switched globally or required disabling the built-in loop. This made it impossible to run different agent engines (such as Claude Code, Codex, or Pi) in the same DSH instance, or required restarting the session.
@vidge/dsh-omniloop turns this single factory slot into a router. It mounts multiple engine instances and dispatches requests per session, enabling multiple agent loops to run in one DSH instance.
Plugin Overview¶
- Plugin name:
@vidge/dsh-omniloop - Maintainer: vidgewong
- Core value: Run Claude Code, Codex, Pi, or the built-in loop in the same DSH instance, select the engine per session, switch without restarting, and share session storage, history, and tracing information.
Core Features¶
- Multi-engine coexistence: Supports running Claude Code, Codex, Pi, and DSH’s built-in loop.
- Session-level routing: Each session can independently choose the engine to use, and the engine selection is recorded when the session is created.
- Runtime switching: No restart of DSH is required; start a new session to switch engines, while the current session continues running.
- Shared infrastructure: All engines share DSH’s session storage, message format, model routing, and tracing capabilities.
- Output translation: Translates the native output of different engines into DSH’s standard message types, ensuring compatibility for history and streaming.
- Persistent affinity: When a session is restored, it automatically returns to the engine specified when the session was created, maintaining consistency of the session’s origin.
Installation and Configuration¶
After installing the plugin, you must restart dsh web for the changes to take effect.
1. Install the plugin¶
dsh plugin --profile web add @vidge/dsh-omniloop
2. Install the engine SDK (optional)¶
The plugin itself only provides the router and does not include specific engines. Install the corresponding SDK as needed (it must be installed through the dsh plugin command; do not use pnpm add directly):
# Install Claude Code SDK
dsh plugin --profile web add @anthropic-ai/claude-agent-sdk@0.3.220
# Install Codex SDK
dsh plugin --profile web add @openai/codex@0.149.1
# Install Pi SDK
dsh plugin --profile web add @earendil-works/pi-coding-agent@0.84.3
Note: The SDK version must be pinned. Different versions may have incompatible message vocabularies, and version drift can cause configuration failures.
3. Migrate from old versions¶
If you previously installed @vidge/dsh-agent-hub, remove it first to avoid conflicts:
dsh plugin --profile web remove @vidge/dsh-agent-hub
dsh plugin --profile web add @vidge/dsh-omniloop
Usage¶
Selecting an engine¶
When starting a new session in Composer, select the engine from the drop-down menu. Each session remains bound to that engine for its lifetime.
Switching engines¶
To switch engines, start a new session in Composer. The currently running session keeps its existing engine and is not affected by the new selection.
Default settings¶
In DSH settings under the Loop engine option, you can set the default engine for new sessions and control whether the engine selector is shown in Composer.
Authentication and Permissions¶
Different engines have different authentication methods and varying permission policies:
- Claude Code: Credentials are derived from DSH’s LLM configuration; no separate CLI login is required.
- Codex: Log in with
codex loginor set theCODEX_API_KEYenvironment variable. - Pi: Use the
~/.pi/agent/auth.jsonfile or environment variables.
Engine-specific notes¶
- Codex: There is no interactive tool approval mechanism; permissions are determined by the session’s
sandboxModeandapprovalPolicy. - Pi: There is no permission system; the entire child process is sandboxed through DSH’s subprocess service (default is read-only).
Notes¶
- SDK installation method: SDKs are optional peer dependencies and must be installed into the profile directory where DSH runs using
dsh plugin --profile web add; do not usepnpm adddirectly. - Impact of missing SDK: If an engine without the corresponding SDK installed is selected, the current turn will fail, but this will not affect other sessions or engines.
- Persistence: A session’s engine affinity is recorded at creation time, and the session returns to the recorded engine when restored.
Conclusion¶
@vidge/dsh-omniloop solves the difficulty of multi-engine collaboration caused by DSH’s single AgentFactory limitation. Using a router pattern, it allows developers to flexibly switch between Claude Code, Codex, or Pi in the same instance while maintaining session state consistency.