dsh-parallel-tools-prompt:用依赖感知提示减少工具调用往返

Introduction

When running Agents in DeepSeek Harness (DSH), the model often sends only one tool call at a step, waits for the result, and then decides on the next step. Splitting multiple independent, input-known calls into multiple rounds of model-tool round trips prolongs task time and increases conversation turns. While the host scheduler can execute tools concurrently, whether the model batches calls in a single response depends on the prompt and compliance, not just the runtime.

dsh-parallel-tools-prompt is a host-only plugin provided by maintainer lloydzhou: through a stable dependency-aware prompt, it guides the model to place currently ready, mutually independent necessary tool calls in the same response. It does not add new model requests, does not add new tools, and does not change host security classification or scheduler; it is not a DAG executor, nor does it guarantee cost or latency reduction. The following introduces its positioning, injection method, configuration, and acceptance boundaries.

What is This

The full plugin name is dsh-parallel-tools-prompt, repository address https://github.com/lloydzhou/dsh-parallel-tools-prompt. The current source version is 0.2.1-rc.7, license MIT, targeting DSH >=0.2.1-rc.3, Node.js >=24.9.0.

The core value in one sentence: Using CONTEXT reminders and optional system prompt fragments to explain to the Agent “discover actions first, use internal DAG to judge dependencies, and send ready, independent calls in the same round within limits,” thereby reducing unnecessary model round trips. The effect depends on model compliance, task dependencies, and the runtime environment; the README explicitly states no paid A/B testing has been done yet.

Community directory page: https://www.skillhub.cn/plugins/lloydzhou/dsh-parallel-tools-prompt. SkillHub is an independent site and has no official affiliation with DeepSeek / Fuzhi.

Core Features

Two Injection Channels

The plugin provides two independent switches, with contextReminder enabled by default:

  1. contextReminder (default true)
    Through agent/pre-step, a CONTEXT message is appended to the next step with source.kind set to parallel-tools-scheduling. It writes to the session history and renders as a CONTEXT block, with a mechanism identical to the host time-context. It applies to all Agents (including sub-agents), all presets, and sessions without presets; presetIds does not restrict this channel. Delivered at most once per Agent; existing or inherited reminders are not injected repeatedly. The reminder enters history, and uninstalling it does not delete content in history.

  2. systemPromptSection (default false)
    Optional. When enabled, it injects a fixed name parallel-tools:guidance (order 1050, no interpolation) via systemPrompt.section(). It does not inject timestamps or tool lists per round. It only takes effect for root Agents that match criteria and specific presetIds. The default target is the standard root Agent, skipping sub-agents and presets not in the list.

Both can be enabled simultaneously; if both are closed, the plugin injects no content. The plugin details page (Plugins → This Plugin) provides a settings form; switches are written to the current profile’s patch immediately; contextReminder takes effect in the next step, and the system prompt switch takes effect on sessions reassembled after modification.

Scheduling Rules (Prompt Logic, Not Executor)

The two channels share stable rules in src/prompt.ts:

  • Nodes are useful tool calls; Edges are required predecessor results, execution conditions, approvals, and shared state order (including read-then-write).
  • Ready means prerequisites are met and parameters are known. Calls that are known, ready, independent, and within tool/output limits are sent in the same round. When there is only one ready call, a single call is correct; do not invent work just to fill a batch.
  • Collecting evidence and aggregating judgment are separate: Independent reads can be in the same round; real dependency chains like test → failure → fix → retest should remain serial.
  • Batching and execution concurrency are separate: Multiple calls in the same round reduce model round trips; whether tools actually run simultaneously is decided by the DSH scheduler and security limits.

The DAG is merely an internal mental model; there is no requirement to draw it or add special scheduling rounds. Normal plan, todo, and approval processes must still be observed.

Skill Distribution

skills/batch-tool-calls/SKILL.md inside the repository allows copying the same rules to other agent tool directories in environments that support skills; environments that do not support skills can copy the body into AGENTS.md / CLAUDE.md and other persistent instructions. Effectiveness outside DSH has not been verified.

Development and Helper Scripts

Local verification commands provided by the maintainer:

npm ci
npm run build
npm run typecheck
npm test
npm pack --dry-run

Offline session analysis (requires explicitly specifying the log file):

node scripts/analyze-session.mjs --help
node scripts/analyze-session.mjs /path/to/session.v4.jsonl.zstd

Optional debug configuration such as debugEnabled is only explained in the README and is disabled by default; when enabled, logs contain sensitive prompt content and must be managed by yourself.

Installation and Enablement

The installation method recorded in the README is to manually add this plugin directory to the target profile after confirming the build passes, rather than using a remote add command spliced by the repository name:

dsh plugin --profile web add .

In the Desktop environment, change --profile web to --profile desktop. When invoking the plugin directly, it defaults to enabled: false; when installing via bundle, it must be explicitly enabled.

cordis.patch.yml or profile override example (Note: config is a whole replacement, not a deep merge, so override items must be written in full):

enabled: true
systemPromptSection: false  # default; set to true to enable system prompt channel
contextReminder: true       # default; all agents (sub-agents), no preset restriction
presetIds: [standard]       # default; only filters target root agents for system prompt channel

If enabled: true is omitted when overriding the profile, it falls back to the default false, and the plugin silently injects nothing. presetIds is a precise ID list and only controls the system prompt channel; the CONTEXT reminder still covers PTC, minimal, creator, etc. presets. Do not add PTC to presetIds to avoid imposing extra system guidance on dedicated execution modes.

Please read the repository source code and the MIT license before installing; the plugin runs under the current DSH process permissions, just like any third-party plugin, and you must evaluate trust boundaries yourself.

Typical Usage and Acceptance

  1. Complete npm ci / build and dsh plugin ... add . as described above, and set enabled: true and required channel switches in the configuration.
  2. Open Plugins → This Plugin on the Web side, and toggle contextReminder and systemPromptSection as needed.
  3. Verify the CONTEXT channel: A message with source.kind parallel-tools-scheduling appears in the session.
  4. Verify the system prompt channel (if enabled): A Tool-call scheduling: related snippet appears in system/message of a new session.
  5. When evaluating tasks, distinguish three scenarios: “ready but not batched”, “have not yet discovered other work”, and “exist real dependencies” to avoid asserting benefits based solely on single-call or multi-call ratios in a single round.

Applicable Scenarios and Notes

Who is it for: Developers who are already using standard or sub-agent tool calls in DSH 0.2.1-rc.3 and above, want to reduce model round trips for independent calls using prompts, and accept “uncertain compliance and no cost guarantee.”

Unsuitable expectations: Scenarios requiring a deterministic DAG executor, automatic cost optimization, or forced multi-calls per round. The README emphasizes that successful injection does not equal model compliance, nor does it equal runtime concurrency or faster/saving tasks.

Version and Release: 0.2.1-rc.7 follows the DSH 0.2.1 version line, with independent RC number increments; npm pre-release defaults to next tag. After source code updates, it is recommended to restart the host to load new modules; plugin reloading will re-attach sections to surviving target Agents and override the reminder channel.

Reference Boundaries: The idea draws inspiration from the bash-agent issue, Anthropic’s parallel call guide, LLMCompiler, Superpowers, and other resources, but this plugin is merely a short prompt text written for DSH, not porting external executors. Lifecycle tests only prove correct connection and cleanup, not that it is faster or cheaper.

Conclusion

dsh-parallel-tools-prompt conveys the scheduling guidance of “batch ready, independent calls in the same round” through CONTEXT and optional system prompts, without touching the host scheduler and security. It comes with a settings UI and skill copy rules. If you need to enable it locally, refer to the build in the README and dsh plugin --profile <name> add ., and verify the injection path using the acceptance methods above.

羽毛球分组比赛记分
小程序二维码

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

Xiaoye