Introduction

In the use of DeepSeek Harness (DSH), when you switch sessions between different models, the system typically behaves as follows: after switching to a new model, the current default reasoning effort level of that model is applied automatically. When you switch back to a previously used model, the previously set reasoning effort level is often not preserved; instead, it is reset to the default value of the target model.

dsh-effort-memory is a Host-only plugin that records the last effective reasoning effort level for each (provider, model) route and restores it when the session switches back to that model.

Plugin Overview

This is an external plugin for DeepSeek Harness (DSH), maintained by developer cup113. It does not depend on any client UI or React components and runs entirely in the DSH Host layer.

The core function of the plugin is to use DSH’s public command interface to reissue model selections, thereby persisting reasoning effort level settings.

Core Capabilities

  1. Host-only implementation: It exists only inside the DSH process and contains no UI code or client-side logic.
  2. Memory and restoration: It uses (provider, model) as the key to remember the last effective reasoningEffort for the route.
  3. Automatic restoration: When the session route changes and switches back to the model, the plugin reissues the selection through ctx.sessionController.selectModel, applying the previously saved reasoning effort level to the current session.
  4. Safety mechanisms:
    • Loop-safe: It triggers only when the route actually changes and the effort level in the event differs from the remembered value, preventing infinite loops.
    • Replay-safe: It correctly handles constructor seeds for sessions (such as recovery and fork scenarios) and checks sequence numbers.
  5. Fault-tolerant design:
    • If the target model no longer supports a given reasoning effort level, it silently falls back to the model default without throwing an error.
    • If the model declares that it does not support reasoning, no action is taken.
    • There is no retry mechanism; any failure is only logged.

Installation and Enabling

The plugin is installed through DSH’s plugin system. After installation, restart the DSH process for the configuration to take effect.

dsh plugin --profile <name> add github:cup113/dsh-effort-memory

Persistence and Configuration

The plugin’s memory feature relies on DSH storage domains.

  • Storage domain: It uses the effort_memory domain; the data table name is efforts.
  • Storage path: When the base storage stack is mounted, data is stored at $DSH_HOME/storages/effort_memory.json and is preserved across process restarts.
  • In-memory fallback: If ctx.storageDomain is missing from the context, the plugin degrades to a process-local Map and logs a warning when applying. This state is lost after the process restarts.

Use Cases and Notes

  • Use case: Developers who frequently switch between multiple models and want a specific model to retain the same reasoning effort level after switching back.
  • Global memory: Memory is global; all sessions and workspaces share the same memory entry for a (provider, model).
  • Limitations:
    • The plugin applies to all active sessions, including subagent sessions.
    • If sessionProjections is unavailable, the first switch after a restart can only establish a baseline and cannot restore previous memory.
    • Single-process visibility only; data is not synchronized across processes via domain/changed.

Conclusion

dsh-effort-memory addresses the pain point of lost reasoning effort levels caused by model switching in DSH through a minimalist design (only one core command interface). It does not write configuration files or provide a UI toggle; instead, it intervenes at the code level to ensure continuity of model settings.

For more technical details, source structure, and test cases, please refer to:
* GitHub repository
* DSH plugin directory