Preface¶
In multi-model collaboration scenarios, models tend to execute tasks directly rather than delegating them to more suitable models. Relying solely on prompt constraints often fails. Dispatch Gate is a DSH plugin that implements physical constraints at the tool-calling layer, forcing the AI to dispatch tasks before executing them.
Introduction¶
Dispatch Gate is a DSH plugin maintained by AlanKhronos. It intercepts tool calls and enforces a requirement for a dispatch record within the session before proceeding. When no dispatch has occurred, tools such as pwsh, write, and edit cannot be executed. The plugin supports evidence-based release, behavior ledger logging, and a rollback switch.
Prerequisites¶
- DSH: DeepSeek Harness, version >= 0.1.7.
- Node.js: Version >= 20.
This plugin relies on DSH’s Cordis plugin system and thetoolsinjection environment.
Core Features¶
- Intercept Tool Calls: Intercepts the
pwsh,write,edit,ego_*execution family, and research tools (e.g.,web_search). - Enforce Dispatch First: The aforementioned tools cannot be executed if there is no dispatch record in the current session.
- Evidence-based Release (v10): Version v10 requires providing evidence rather than just a declaration. Key parameters (e.g.,
command,file_path) must be included. - Behavior Ledger: Records details of releases and interceptions for auditing purposes.
- Rollback Switch: Allows reverting to v9 declarative semantics via configuration.
Installation and Activation¶
This plugin is installed via plugin_manager install_bundle. Mount it in bundle.patch within cordis.patch.yml:
- insert:
- id: dispatch-gate
name: '@alankhronos/dsh-dispatch-gate'
config:
# See configuration below
Configuration¶
Modify the config: section in cordis.patch.yml:
| Config Key | Default Value | Description |
|---|---|---|
workTools |
['pwsh','write','edit'] |
Tools for direct execution |
workToolPrefixes |
['ego_'] |
Tool families matched by prefix |
researchTools |
['web_search', ...] |
Tools for research/information retrieval |
requireDispatchEvidence |
true |
v10 evidence switch; set to false to revert to declarative mode |
permKeywords |
['perm','privilege','high-risk'] |
Keywords for permission-based channels |
subagentGraceMs |
10000 |
Fallback time window (in milliseconds) |
guardFailClosed |
true |
Whether to reject when a guard exception occurs |
Typical Usage (SELF-DO)¶
v10 requires evidence; there are three valid syntaxes:
- Permission-based Self-Execution:
SELF-DO: perm=<pwsh|high-risk|privilege>; reason=<why permissions exist only with you>
- Structured Evidence:
SELF-DO: tried=<zhipu,modelscope>; reason=<why the other party couldn't do it / why you must do it>
- Dispatched in Current Session:
SELF-DO: <one-sentence reason>
Prerequisite: dispatch > 0 or dispatchFailed > 0 in the current session
Behavior Ledger¶
The plugin logs behavior to logDir/dispatch-stats.jsonl. Main event types include:
- dispatch: Successful dispatch
- selfdo: Self-execution release
- selfdo-permit: Release with evidence
- blocked: Intercepted
- dispatch-failed: Dispatch failed (Failure counts as evidence)
Conclusion¶
Dispatch Gate replaces prompt discipline with physical constraints, ensuring models delegate before executing. Its behavior ledger facilitates auditing. For more details, please refer to GitHub or the DSH Directory.