dsh-multi-acp: Driving DSH Sessions with an External ACP Agent CLI

A DSH session is driven by an external ACP agent CLI as the root agent. DSH’s built-in @deepseek-ai/dsh-acp operates in the reverse direction; this plugin does not reuse it. By replacing the factory and registering a preset, the plugin lets DSH’s engine data layer drive an external process rather than code.

What This Is / Is Not

Is DSH acts as an ACP client and drives external CLIs (omp / opencode / command-code) as the root agent
Is DSH delivers its MCP servers to the engine with session/new (so the engine can use knowledge bases and other resources configured in DSH)
Is not DSH acting as an ACP server. DSH’s built-in @deepseek-ai/dsh-acp is the reverse direction; this plugin does not reuse it
Is not The provider approach (external CLI only acts as the “brain”; the loop still belongs to DSH)
Is not The subagent approach (official @deepseek-ai/dsh-subagent-acp)
Note ACP-injected MCP to the engine is fully available (no approval/authorization fields)
Note Key names (such as token, secret) are redacted as <redacted>

Core Features

  1. Engine data layer: The engine is a data row; adding a new engine only requires one line of configuration.
  2. ACP client / process host: Encapsulates ACP client and process hosting logic.
  3. Plugin wiring: Replaces the factory + registers the preset.
  4. Sessions are truly driven by the engine: Session flow is taken over by the external ACP engine.
  5. Preset native tool surface: Before the fix there were 164 tools and zero native tools; now it includes read/write/edit/glob/grep/pwsh/skill, etc.
  6. MCP injection with session: By default, connections in <DSH_HOME>/storages/mcp_connector.json where enabled !== false are mapped to ACP McpServer.
  7. Engine tool call echo: Meets the DSH session format contract, showing tool/call + tool/result in the trajectory.
  8. Engine command/skill discovery echo: Exposes the command list via acp.available_commands.
  9. Engine management UI: Covers startup method, environment variable row editing, four-state filter + search, two-column information grid + semantic diagnostic capsules.
  10. Duration and timeout controllable: Configured via promptTimeoutMs; <=0 means no timeout.
  11. History file repair tool: Repairs contract issues in session logs.

Configuration

Configuration is located in cordis.patch.yml. Note that non-insert patch lines are whole replacement after being located by id; the config of that Entry is not deep-merged with the profile.

Basic Configuration Items

Field Default Description
defaultEngine '' Which engine is used for sessions without an explicit preset; blank = use the official DSH agent loop
stateDir <DSH_HOME>/multi-acp Location for engine definitions, session mappings, and trace.log
verboseStartup true Print host symbol self-check results at startup
presetTools true Which native tool groups are attached to acp-* presets: true / false / array
unsandboxedFs false true = mask the host sandbox fs with entry-local dsh-fs-local
mcp {enabled:true, include:[], exclude:[]} MCP distribution strategy with sessions
promptTimeoutMs 300000 Timeout for one session/prompt; <=0 = no timeout
trace true Diagnostic tracing to <stateDir>/trace.log; false/'off' = disabled

Example: Adding an Engine

Engine definition priority: built-in BUILTIN → <stateDir>/engines.json → plugin config.engines. Overridden as a whole by id.

// <DSH_HOME>/multi-acp/engines.json
{
  "engines": [
    {
      "id": "mytool",
      "label": { "zh": "我的工具", "en": "My Tool" },
      "command": "mytool",
      "args": ["acp"],
      "cwdPolicy": "session",
      "mcp": "inherit",
      "promptTimeoutMs": 0,
      "enabled": true,
      "sortOrder": 40
    }
  ]
}

MCP Distribution Strategy

By default, connections in <DSH_HOME>/storages/mcp_connector.json where enabled !== false are mapped to ACP McpServer. Delivered with session/new and session/load.

mcp:
  enabled: true
  include: []              # 只下发这些(按 name / serverName / serverKey 匹配)
  exclude: ['dingtalk']    # 排除这些

Typical Usage

  1. Before startup: Configure engine definitions in <DSH_HOME>/multi-acp/engines.json.
  2. Before a session: For a new session, read AGENTS.md first to understand evidence levels and verification commands.
  3. Configure presets: Set presetTools to true or an array to enable the native tool surface.
  4. Control timeout: Configure promptTimeoutMs to control timeout; 0 is recommended for long-running tasks.
  5. MCP injection: Ensure the connection settings in <DSH_HOME>/storages/mcp_connector.json are correct.

Notes

  • Configuration trap: Non-insert patch lines are a whole replacement after being located by id. Before modifying configuration, verify the configuration that is actually in effect.
  • Permissions: The plugin runs with the current DSH process permissions; check the source code and license before installation.
  • Data redaction: trace logs automatically redact sensitive fields (such as token, secret), but session logs may still contain sensitive information; do not upload them directly.
羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye