Preface

When using DeepSeek Harness (DSH) for long-conversation development, context window management is a common pain point. As a conversation approaches the context window limit, directly truncating or expanding the context can disrupt session continuity. At the same time, injecting a persona for a specific role by directly overwriting the System Prompt may interfere with Harness’s own identity settings. DSH’s plugin ecosystem is designed to address these kinds of issues.

Plugin Overview

dsh-whale-companion is an external DSH plugin maintained by xianshu-virtuous. It provides two core capabilities: first, it adds a Blue Whale girl maid persona by appending a Section, without overwriting the Harness identity; second, when a WebUI session reaches 88% of the context window, it automatically creates a new session and hands over the context.

Core Features

1. Blue Whale Girl Persona Append

The plugin uses an independent whale-companion:persona section (order 10). The default persona is “Shen Shen,” distinguishing between Flash and Pro forms. This only appends character tone and does not replace the Harness identity settings.

2. Automatic Session Continuation

The plugin triggers automatically when the WebUI client remains open, the current session belongs to a Workspace, and the context reaches 88%. The new session receives only the last user request and assistant reply as handoff context (up to 24,000 characters) and uses the Workspace’s default Agent preset.

3. Tools and Configuration

  • Tool: Provides the read_whale_persona tool, allowing the persona to be re-read on demand when a task is concluding or when persona details drift.
  • WebUI: Adds a “Whale girl persona” page, supporting direct body input (without triple quotes) or overwriting the default persona.
  • Configuration: Supports overriding or disabling the plugin in cordis.patch.yml.

Installation and Enabling

First, enter the plugin directory and run the build and tests:

pnpm install
pnpm run typecheck
pnpm test
pnpm run build

Then add the plugin via the command line:

dsh plugin --profile web add F:\dsh\dsh-whale-companion

After adding it, you need to restart the dsh web process.

Typical Usage

Configuration Switch

Set the following in cordis.patch.yml:

- insert:
    - id: dsh-whale-companion
      name: '@dsh-external/dsh-whale-companion'
      config:
        enabled: false

Custom Persona

On the WebUI “Whale girl persona” page, directly enter the body text and click “Overwrite persona.” The content is saved to $DSH_HOME/plugins/dsh-whale-companion/persona.json.

Tool Invocation

The model calls read_whale_persona in the following situations: when a task is concluding, after a context transfer, or when persona details drift. The plugin prompt explicitly requires that this tool not be called every turn.

Notes

  • WebUI Dependency: The automatic continuation feature depends on the WebUI client remaining open.
  • Session Filtering: Sessions that do not belong to a Workspace are skipped.
  • Process Restart: If the old process has not loaded the configuration interface, a restart will be prompted.
  • Fault Tolerance: If persona.json becomes corrupted due to manual editing, the plugin automatically falls back to the default persona and does not block Harness startup.
  • Preset Behavior: The new session uses the Workspace’s default Agent preset and does not copy the source session’s preset.

Conclusion

Through Section appending and a context handoff mechanism, this plugin provides DSH users with a low-intrusion role-playing solution and a long-conversation solution.

Directory Page: xianshu-virtuous/dsh-whale-companion
Source Repository: GitHub