description: "Reload plugin code and profile configuration through one coordinated queue."
English | 中文
Reload plugin source and configuration while an application is running. Module replacements, Include refreshes and profile configuration changes share one queue. Package installation runs outside that queue. Existing Cordis HMR configuration and events remain available under ctx.hmr.
The base bundle enables HMR with root: [] when the launcher supplies profileContext; hosts without that profile context leave this entry disabled. Headless, SDK and ACP bundles disable that entry in YAML; a later profile patch can enable it. Disabling or omitting HMR applies changes on restart. To enable source-module watching, configure the hmr entry supplied by the base bundle in the profile patch before launching:
- id: hmr
disabled: false
config:
root: ["."]
Existing configurations replace the module name @deepseek-ai/cordis-plugin-hmr with @deepseek-ai/dsh-hmr. The hmr service key, baseDir, config, getLinked(), getOuterStack(), hmr/change and hmr/reload remain available. The vendored package remains available; DSH profiles use this package.
| Field | Default | Meaning |
|---|---|---|
base |
Context base URL | Base directory for module watching. |
root |
["."] |
Module watch roots; [] retains only explicit configuration watches. |
ignored |
["**/node_modules", "**/.*", "cache", "data"] |
Excluded module paths. |
debounce |
100 |
Milliseconds for combining module changes. |
Chokidar options, including polling, retain their existing meaning. Exact configuration watches also observe additions, removals and initially missing parent directories. They default to awaitWriteFinish: true: edits wait for Chokidar's 2-second write-stability window, avoiding its lossy change-event throttle. Configure awaitWriteFinish to adjust that window; disabling it can miss rapid consecutive edits. Direct Plugin Manager operations apply without waiting for file events.
ctx.hmr adds no model-facing tools or messages. Loaded plugins determine subsequent tool and prompt contributions.
No direct token contribution.
Reloading a contributing plugin can change later request prefixes; HMR does not rewrite conversation history.
loader.exit() hook; HMR itself does not restart the process.None.