# dsh-fixed-new-session-model [中文](README.md) | English [![npm](https://img.shields.io/npm/v/dsh-fixed-new-session-model)](https://www.npmjs.com/package/dsh-fixed-new-session-model) [![stars](https://img.shields.io/github/stars/chenyangcun/dsh-fixed-new-session-model?style=flat)](https://github.com/chenyangcun/dsh-fixed-new-session-model) Keep the default Agent preset and model stable for new DeepSeek Harness (DSH) sessions, with optional per-workspace overrides. Open **Settings → Default Preset & Model** to manage everything in one place. ![Global default settings](docs/images/global-defaults.png) Each workspace can inherit the global defaults or bind its own preset and model. ![Workspace-specific settings](docs/images/workspace-defaults.png) ## Install ```sh dsh plugin --profile web add dsh-fixed-new-session-model ``` Restart the current DSH Web process after installation, then open **Settings → Default Preset & Model**. To install from source or work on the plugin, run this inside the repository: ```sh dsh plugin --profile web add . ``` ## What you get - **Stable global Agent preset** — choose the preset used by new sessions when no workspace override exists - **Stable global model** — choose the provider, model ID, and reasoning effort independently of temporary in-session model changes - **Workspace-specific rules** — assign a dedicated Agent preset and model to each workspace - **Field-level inheritance** — override only the preset while the model follows global defaults, or configure both - **Automatic application** — apply the matching rule when a workspace session is created or an existing blank session is reused - **Safe existing sessions** — sessions that already contain conversation content are not force-switched in the background - **Native settings UI** — edit, inspect, and reset rules from the DSH Settings page ## Use 1. Open **Settings → Default Preset & Model**. 2. Under **Global Defaults**, choose an Agent preset, provider, model, and optional reasoning effort, then save. 3. Open **Workspace Overrides** when a project needs a different setup. 4. Select the workspace and choose a preset. Let the model follow global defaults or bind a workspace-specific model. 5. Create a session or switch to a blank session in that workspace. The matching defaults are applied automatically. **Restore Global Defaults** removes the selected workspace rule. It does not change the global configuration. ## Precedence ```text Workspace override ↓ inherit fields not explicitly configured Global plugin defaults ↓ Original DSH defaults ``` Preset and model inheritance are independent. For example, a workspace can always use `standard-codex` while its model continues to follow the global selection. ## How it works - The Host plugin registers the `workspace-defaults` settings schema and prevents temporary session model selections from overwriting the stored global default. - The Web client registers a native `settings.section` page. - Before a workspace session is created, the matched Agent preset is injected into `session.create`. - When DSH reuses a blank workspace session, the plugin synchronizes both preset and model before the session is opened. - Rules are stored through DSH's existing settings system; the plugin creates no separate database or credential file. | Settings namespace | Stored data | | --- | --- | | `agent-presets` | Global Agent preset | | `agent-default-model` | Global provider, model, and reasoning effort | | `workspace-defaults` | Per-workspace override rules | ## Compatibility This plugin supports standard DeepSeek Harness (DSH) and has been verified with: - `@deepseek-ai/dsh` `0.1.1-rc.2` and `0.1.2-rc.1` - The standard Web Profile - npm-installed and local `link:` bundles This plugin uses DSH Settings, Remote, and model-selection services. After a DSH upgrade, rerun `pnpm install` in the Web Profile and verify that the settings section still loads. ## Security - Does not read or store model API keys - Makes no external network requests - Uses only DSH's settings, session, workspace, preset, and model-selection APIs ## Development ```sh node --check index.js node --check lib/client.js npm test npm pack --dry-run ``` ## License [MIT](LICENSE) Bug reports and suggestions are welcome in [Issues](https://github.com/chenyangcun/dsh-fixed-new-session-model/issues).