Preface¶
When developing with DeepSeek Harness (DSH), the order of the left-side workspaces directly impacts interaction efficiency. By default, the workspace list is static; as sessions increase, recently used workspaces tend to sink to the bottom. The dsh-workspace-recency-order plugin solves the issue of static workspace ordering by performing low-level operations on the Host side.
Plugin Introduction¶
This is a Host-side plugin maintained by the developer dgmico. Its core function is to automatically rearrange the order of the left-side workspaces based on the most recent session activity time within each workspace (Host-side logic, writing to the official persistent workspace order, without overriding the official UI).
Core Features¶
- Host-side Plugin: Directly manipulates the Host-side workspace registry rather than injecting DOM or replacing components.
- Auto-rearrangement by Latest Session Activity: Workspaces are sorted based on the latest active time (
updatedAt) of the sessions within them. - Persistent Sorting: The order is maintained after restarting DSH and continues to be automatically managed.
- Real-time Updates: Listens to events to adjust the order in real-time when a user sends a message.
- No UI Override: Leverages official rendering logic; only the Host-side data is modified, and the UI follows automatically.
- Idempotent Rearrangement: If the calculated order matches the current one, no write occurs, avoiding redundant operations.
- Configurable: Offers various configuration options to adjust sorting behavior.
Installation and Activation¶
The plugin supports installation via an absolute path.
dsh plugin --profile <profile> add /absolute/path/to/dsh-workspace-recency-order
After installation, the plugin handles configuration automatically. If manual intervention is required, configuration items can be added to the profile’s cordis.patch.yml.
Configuration¶
Restating the full line by id in the profile’s patch layer (~/.dsh/profiles/<profile>/cordis.patch.yml). The patch replaces the config line-by-line, so you only need to write the keys you wish to modify.
- id: workspace-recency-order
name: 'dsh-workspace-recency-order'
config:
sweepMs: 0 # Disable fallback sweep
debounceMs: 1000 # Relax debounce to 1 second
| Option | Default | Description |
|---|---|---|
enabled |
true |
Plugin enable switch. |
direction |
'desc' |
Sort direction; desc puts most recently active at the top, asc puts least recently active at the top. |
emptyWorkspace |
'createdAt' |
Sorting strategy for empty workspaces: createdAt sorts by its own creation time, bottom fixes it at the bottom, top fixes it at the top. |
countSubagentSessions |
false |
Whether to count subagent sessions (origin: 'subagent') towards activity. |
debounceMs |
400 |
Event merging debounce window (milliseconds). |
sweepMs |
300000 |
Fallback sweep interval (milliseconds), 0 disables it. |
skipWhenSessionListEmpty |
true |
Skip sorting for the current cycle if the session list cannot be read. |
Note: This plugin does not depend on
@deepseek-ai/schemastery, so the DSH configuration page cannot display forms. To change settings, you must directly editcordis.patch.yml.
Development and Maintenance¶
The plugin is written in a zero-dependency, pure ESM mode.
- Testing: Includes 54 test cases, covering correctness validation for write plans across 24 full permutations of workspaces and random shuffles.
- Development Files:
lib/order.js: Core sorting logic.lib/index.js: The plugin body, handling events, debouncing, and lifecycle.
- Hot Reload: The plugin itself supports hot reloading, but modifying source code under
lib/requires restarting DSH.
Notes¶
- Global Persistence: The order is globally persistent and applies to all clients under the profile.
- Subagent Handling: Subagent sessions do not participate in activity calculation by default.
- Time Baseline: The “latest time” used for sorting is based on the last user message, not the assistant’s reply time.
- Restart Requirement: You must restart DSH after modifying code under
lib/. - UI Limitations: DSH currently does not provide a manual drag-and-drop sorting UI, so the plugin will not conflict with manual operations.