Introduction¶
In DeepSeek Harness (DSH), when building agents with a planned mode, a common approach is to switch between different presets. During planning, one wants to call native tools like standard (read, grep, edit, etc.) directly; after user approval, one wants the execution phase constraints to be like PTC, where the top level can only be run_code, bundling multi-step operations into the program. Switching back and forth between these two sets of presets makes the tool table and system prompt prone to inconsistency and may trigger the rebuilding of request prefix cache, increasing latency and token overhead.
Below is an introduction to the community plugin dsh-presets-plan-native-act-ptc (maintainer Oyyyyyy-y): using a preset named ptc-hybrid, it distinguishes between the “Planning” and “Execution” stages at the top level using a router, under the same set of tool declarations and system prompts.
What is this¶
This package is a bundle plugin for DSH that patches profile configuration via dsh.bundle.patch and registers the preset PTC Hybrid (Plan=Standard, Act=PTC) (preset ID inside the package is ptc-hybrid). The README specifies its scope as: standard tool tree + tool-executor-ptc + router, without including agent layer plugins. Categorically, it is listed under “Workflow” in the SkillHub directory. The current package.json version is 0.1.4, license MIT, and requires DSH version >=0.2.2-rc.1 <0.3.0-0 (the README notes it was developed on DSH 0.2.2-rc.3).
Two-Stage Tool Strategy¶
The core of the plugin is plugins/superset-router.mjs: it limits the top-level callable tools depending on whether it is in plan mode. The tool table and system prompt declared externally are the same for both stages, and the /plan switch does not rebuild the request prefix cache (README实测: entering plan hits ~98%, leaving plan ~99%).
| Phase | Top-level directly callable | Inside program (run_code) |
|---|---|---|
| Planning | All native tools (e.g., read / grep / glob / pwsh / edit / exit_plan_mode / workflow / plugin_manager, etc.); run_code is rejected |
None (no program in planning phase) |
| Execution (after approval) | Only run_code |
All native tools, but workflow / plugin_manager are rejected |
The behavior of the planning phase is consistent with the built-in standard preset; the top-level of the execution phase is consistent with the built-in PTC, and native tools are available inside the program (except for the aforementioned two management tools).
When questions need to be asked to the user or approval is awaited, timeoutMs should be passed to run_code (default 120,000 ms; upper limit determined by deployment config, default 600,000 ms). The README notes: approval waiting counts against the program budget, and long waits should explicitly set timeoutMs.
Installation and Enablement¶
Installation is done by merging through the bundle’s cordis.patch.yml, usually requiring no manual editing of profile files.
Install to a specific profile from GitHub:
dsh plugin --profile <profile> add github:Oyyyyyy-y/dsh-presets-plan-native-act-ptc
If using a local plugin directory (README example profile name is demo):
dsh plugin --profile demo add ./dsh-presets-plan-native-act-ptc
dsh --profile demo --dump-config # Should see "# == dsh-presets-plan-native-act-ptc" layer
After desktop installation, restart DSH and select PTC Hybrid (Plan=Standard, Act=PTC) in the session preset selection.
Uninstall:
dsh plugin --profile <profile> remove dsh-presets-plan-native-act-ptc
Typical Usage (Workflow)¶
- Install the plugin in the profile and restart DSH; select
ptc-hybridin the session preset (the one labeled “PTC Hybrid” in the interface). - Enter plan mode (e.g.,
/plan): useread,grep, etc., at the top level to figure out the repository and constraints, and organize a plan; in this phase, do not expect top-levelrun_codeto be available. - After the plan is ready, complete approval via flows like
exit_plan_modeto enter the execution phase: the top level should only drive changes viarun_code, with specific file reading/writing etc. placed inside the program to call native tools. - If confirmation from the user is needed during execution, set sufficient
timeoutMsinrun_codeto avoid the default 120-second budget ending prematurely.
The README does not provide standalone business scenario scripts; the above steps correspond to the declared two-stage model and can be extended according to the project.
Failures, Degradation, and Limitations¶
Degradation (README “Failures and Degradation”)
- Executor module load failure: The router is not installed, and the session reverts to the preset’s built-in PTC executor (top-level only
run_code). The log shows asuperset-router: ...level warn. run_codetransport unavailable: The directory only declares native tools, and the act phase allows native tools. The log shows asuperset-router DEGRADED ...error, and phase reminders are rewritten. No tools will be available.- Confirm router is mounted: Look for
superset-router: installed for <session>in the log.
Known Limitations (Excerpt)
- The
sectionconfiguration forplan-modedoes not take effect; plan instructions are inplanReminderinplugins/superset-router.mjs, so changing the prompt requires modifying that location. - The act phase does not have PTC’s tools SDK type declaration; program parameters rely on the current request’s tool JSON Schema, and TypeScript rules have been merged into phase reminders (runtime-context).
- The tool table for the plan phase still lists
write/edit: DSH’s plan mode relies mainly on prompt constraints to align with standard, not strict permission gates. exit_plan_modeis still declared in the act phase but unavailable, and calls are rejected with a reason.plugin_managermay not appear: Like the built-in standard preset, it depends on whetherprofileContextis available.
Suitable Scenarios and Notes¶
Who is this for
- Already using DSH plan mode and wanting a unified PTC-style “top-level only
run_code” execution model after approval. - Care about keeping the same tool catalog and system prompt during plan/act switching to reduce prefix cache invalidation (README gives hit rate data, results may vary by environment).
Usage Notes
- The plugin runs with the current DSH process permissions; please read the repository source code and the MIT license before installing.
- The DSH Community Directory (SkillHub) is a separate site with no official affiliation with DeepSeek/Huansuan; plugin stars and other information are based on the directory and GitHub page (currently 0 stars in the provided data).
- After upgrading DSH, the repo provides
scripts/gen-cordis-patch.mjsto regeneratecordis.patch.yml(for development, not published with the npm package).
Conclusion¶
dsh-presets-plan-native-act-ptc bundles “Plan=Standard top-level tools, Act=PTC top-level run_code” into a single preset ptc-hybrid, enforced by the superset router by phase, and compares it to the double preset switching in terms of cache stability. To install or view instructions, visit the SkillHub directory page and GitHub repository.