Introduction

Session data for DeepSeek Harness (DSH) is typically stored in JSONL format on the local file system. In existing DSH environments, moving an existing “cold” session from the current workspace to another workspace while preserving its SessionId and full event history is an operation that is difficult to complete directly through standard interfaces. The DSH rc.6 build installed from official channels does not yet include built-in session migration capabilities. The dsh-session-move plugin aims to fill this gap by providing low-level implementation for session migration.

Plugin Positioning

This is a DeepSeek Harness feature plugin package maintained by kirkchinese. Its core purpose is to move an existing cold session between two DSH workspaces while ensuring the integrity of the session ID and history during migration. The plugin’s interaction target points directly at an existing session title row in the DSH Web sidebar.

Core Features

The plugin implements session migration through the following capabilities:

  1. Read-only inspection: Provides ctx.sessionMove.inspect({ sessionId, targetWorkspaceId }) for performing a dry-run inspection.
  2. Sidebar dragging: In the DSH Web UI, users can directly drag a session title row to perform the move operation.
  3. RPC calls: Under the hood, the actual session change is committed via the workspace.moveSession RPC.

Inspection Capability

The inspect interface does not modify data; it only returns the following inspection information:
* The identities of the source and target workspaces.
* The storage paths of the source and target JSONL files.
* Immutable header information of the source and target files.
* The persisted revision number.
* Physical line count and logical event count.
* Consecutive sequence boundaries.
* SHA-256 hashes of events.
* Blocking conditions (e.g., the session is active, archived, target location conflict, backend/core capabilities unsupported, etc.).

Migration Semantics

A successful migration changes only the cwd (current working directory) in the session header and the workspace account that owns it. It does not modify SessionId, creation time, lineage, preset configuration, all logical events, or external dsh-session: references. After migration, the session will belong to the target workspace in future tool calls and sandbox policies.

Installation and Enablement

Installing this plugin requires a DSH build with a specific patch applied. The installation command is as follows:

dsh plugin --profile <profile> add dsh-session-move

If you are using a packaged tarball, you can use the following command:

DSH_HOME=<dsh-home> pnpm dsh plugin --profile <profile> add ./dsh-session-move-0.1.0.tgz

After installation, it is recommended to run dsh --profile <profile> --dump-config to confirm that the configuration is loaded correctly.

Runtime Environment Requirements

  • Dependencies: The plugin depends on @deepseek-ai/dsh-base and host packages such as dsh-headless or dsh-web-app. If the configuration contains only @deepseek-ai/dsh-base, the plugin will not activate because the required host layer is missing.
  • Version Requirements: It must be compatible with the DSH core version (e.g., >=0.1.0-rc.5 <0.1.0-rc.7).

Typical Usage

The plugin provides two main operational approaches:

1. Code Invocation

Invoke read-only inspection through a programming interface, or execute the move through an RPC call:

// 检查迁移可行性
ctx.sessionMove.inspect({ sessionId, targetWorkspaceId })

// 执行移动(通常由 UI 侧边栏拖拽触发)
workspace.moveSession({ targetWorkspaceId, sessionId, beforeSessionId? })

2. Sidebar Operation

In the sidebar of the DSH Web interface, select a cold session title and drag it to the target workspace. The system will automatically call the aforementioned RPC to complete the migration.

Applicable Scenarios and Notes

  • Scope: The current version supports only JSONL sessions and cold sessions (inactive sessions). Migration for SQLite and Windows systems is planned but not yet implemented.
  • Official Version Limitations: The DSH rc.6 build installed from official channels does not include migration or move capabilities and supports only the read-only functionality of the inspect interface mentioned above. To use the drag-to-move feature, a specific patched build must be used.
  • Concurrency and Locks: The plugin relies on DSH’s “one live writer per session/process” model. File-system locks are used only as defense-in-depth and are not used for transactional cross-process concurrent write control.
  • Data Safety: After migration, the plugin verifies the final header, the unique valid workspace owner, event count, and logical event SHA-256 hash. The recovery log is deleted only after these checks pass.

Summary

dsh-session-move provides DSH users with an essential mechanism for managing session history across workspaces. By preserving SessionId and the event stream, it allows developers to reorganize session structure without losing context. For detailed documentation, distribution guides, and rollback procedures, see the project repository.