dsh-session-persistence-mysql
Run the following command in DeepSeek Harness:
dsh plugin install sandersyao/dsh-session-persistence-mysql
Paste the following prompt into your AI chat to install this plugin:
Run dsh plugin install sandersyao/dsh-session-persistence-mysql in DeepSeek Harness to install this plugin; full source is at https://github.com/sandersyao/dsh-session-persistence-mysql.
About this plugin
The default JSONL file backend of DeepSeek Harness is perfectly adequate for single-node setups, but its limitations surface quickly in multi-instance deployments, high-concurrency workloads, or any scenario that demands cross-process session-state sharing. Writes lack transactional guarantees, a hard crash can leave half-written records, and there is no way to offload read traffic to a replica. dsh-session-persistence-mysql exists to close exactly that gap: it persists the event-sourced SessionEvent log into MySQL with a behaviour contract identical to the JSONL backend, so it can be dropped in as a plugin and replace the default implementation seamlessly.
The plugin’s design revolves around three pillars — write safety, read separation, and crash survivability. Every appendBatch lands in a single InnoDB transaction; the log is strictly append-only with contiguous sequence numbers, and the composite primary key makes same-ID double-writes impossible by construction. A dedicated read pool, configured independently via SESSION_READ_* environment variables, serves all read hooks while the write pool handles appends; when no replica is set it transparently falls back to a single shared connection. If a process dies mid-turn, the shared coordinator writes synthetic closers to durably close the interrupted exchange, and committed records are never rewritten. Lazy materialization guarantees the session header and its first event batch commit atomically, bounded deadlock retries keep throughput stable under contention, and idempotent schema creation on startup eliminates manual DDL steps.
It is aimed at teams shipping DeepSeek Harness into production or distributed topologies: multiple dsh instances that must share one session store, operators who prefer database-native backup and replication over file-level snapshots, or read-heavy deployments that benefit from a dedicated replica. In all of these cases the plugin offers a smooth, contract-preserving migration path from the JSONL file backend to a relational database, and it slots naturally alongside dsh-storage-mysql, dsh-credentials-mysql, and dsh-workspace-bootstrap to form a fully distributed deployment.
Screenshots
Use Cases
- Multiple dsh instances in a cluster need a shared session store, replacing the default JSONL backend
- Read-heavy workloads benefit from a dedicated replica for loadStored, list, and listSnapshots hooks
- Production environments demand transactional write guarantees and automatic crash recovery with no torn records
Best For
- Engineering teams shipping DeepSeek Harness to multi-node production environments
- Operators who prefer database-native backup and replication over file-level snapshots
- Backend architects unifying on a MySQL stack alongside dsh-storage-mysql and dsh-credentials-mysql for a full distributed stack
Related Plugins
Memory layer for coding agents that indexes local session history and auto-recalls relevant context before edits, commands, and failures, with no manual search needed.
Traceable, searchable cross-session memory for AI agents that turns conversation knowledge into a typed knowledge graph and recalls relevant subgraphs instead of replaying full history, natively integrated with DeepSeek Harness.
Gives DSH AI cross-session long-term memory, to-do and skill management, plus multi-session orchestration, external AI delegation, and an infinite canvas that grows with you.
dsh-mnemon is a three-tier, pluggable, Agent-driven memory system for DeepSeek Harness, combining Runtime memory, Project Documents, and replaceable Memory Spaces with nine long-term providers.