dsh-auto-preset
Manifest valid★ 1DSH plugin: remembers your last manual permission-preset choice per session and restores it when the session is reopened.
dsh-auto-preset
A small DeepSeek Harness (DSH) plugin that remembers your last manual permission-preset choice for each session and restores it when you reopen that session.
Status: early / experimental. It talks to DSH's experimental
permissionPresetsAPI and was tested against@deepseek-ai/dsh0.2.1-rc.2 and 0.2.1-rc.3 (the permission-presets code is identical in both). A future DSH release may change the API and break it.
Why
DSH's permission presets (workspace-write, danger-full-access, and the experimental auto = auto review) are stored per session. The default preset for a session is inferred from the process defaults, so a session can come back as the wrong mode after a restart — and the experimental Auto preset cannot be configured as the default preset at all:
// @deepseek-ai/dsh-permission-presets
if ("auto" in this.presets) throw new Error('permission: "auto" is reserved ...')
if (!Object.hasOwn(this.presets, defaultPreset)) throw new Error('permission: unknown default preset')
This plugin instead watches what you actually pick and puts it back.
Behavior
- First time a session is opened: do nothing. The system default applies.
- You switch a session to Auto review → remembered. Reopening the session restores Auto review.
- You switch it to Full access → remembered. Reopening keeps Full access; the plugin will not force Auto back.
- You later switch back to Auto review → remembered again. The plugin follows your last manual choice.
In one sentence: it follows your latest manual choice; it never overrides a choice you made.
State is kept in state.json next to the plugin (persists across DSH restarts). Delete that file to reset everything.
Install
From source
git clone https://github.com/heyuanliu3-byte/dsh-auto-preset.git
dsh plugin --profile web add link:/absolute/path/to/dsh-auto-preset
Then add "dsh-auto-preset" to the profile's bundle list (package.json → dsh.profile.bundles) and restart the DSH web server.
From npm
Once the package is published to npm:
dsh plugin --profile web add dsh-auto-preset
The plugin must be loaded after @deepseek-ai/dsh-experimental-auto-review, because the auto preset only exists while that bundle is live.
How it works
session/createdfires when a session enters the store — for a brand-new session and for a reopened one.session/event(permission/preset) tells the plugin which preset was selected. Events emitted before the plugin has "armed" a session (the initial pin) are ignored, and the plugin's ownpresets.set()calls are ignored via a reentrancy flag.- On open, if a stored choice exists and differs from the current value, the plugin calls
permissionPresets.set(session, storedChoice).
See lib/index.js — it is ~130 lines.
Caveats
- Experimental API: the permission-presets internals may change between DSH releases.
- Only
permission/presetevents are observed; a "custom" sandbox/approval combination is not represented as a preset and is therefore not restored. - Web profile only in my setup; it does not require any non-official plugin in the desktop profile.
License
MIT — see LICENSE.
Comments
Loading…
From the same category
by awesome-dsh-plugin
A curated list of plugins for DeepSeek Harness (dsh) · DeepSeek Harness 插件精选列表
★ 20.5k
CC0-1.0
Python
Oct 25, 2026
by 0xsline
DeepSeek Harness (DSH) ecosystem: curated plugins, tools, and infrastructure from dsh-external/hub and the public dsh-plugin topic.
★ 1.3k
CC0-1.0
Python
Oct 16, 2026
by pax-beehive
Open-source CLI, schemas, resolver, and DSH agent tools for DSH Plugin Hub
★ 277
MIT
TypeScript
Oct 20, 2026
by xiajiajun516
DeepSeek Harness (DSH) backup & restore plugin — export, import, migrate and sync your complete DSH configuration, plugins, MCP servers, skills and workspace. One-click migration to another machine.
★ 240
MIT
TypeScript
Oct 24, 2026
dsh plugin --profile web add dsh-config-managerby yjh051108
推荐组件(非必须):DeepSeek Harness 运行时注入器;已随 dsh-routing-suite 单仓库化保留,本仓库继续维护/发布。
★ 167
TypeScript
Oct 16, 2026
dsh plugin --profile web add @dsh-external/dsh-super-injectorby Yuuyuko-uu
DSH 鱼的记忆:给会话一份会淡忘的长期记忆,每条都带时间
★ 135
MIT
JavaScript
Oct 24, 2026
dsh plugin --profile web add dsh-fish-memory