Repository navigation
Conversation
`evercli import conversations` had no reader for dsh, even though dsh is already an install target — so the only EverMe memory a dsh user could get was whatever the native plugin captured after install, never the history that made the agent useful in the first place. The harness keeps one zstd-compressed JSONL log per session at `<DSH_HOME>/sessions/<workspace>/<session-uuid>/session.v4.jsonl.zstd`. The reader maps its event stream onto the existing importer DTO: user/message -> role user (text blocks) assistant/message -> role assistant (text + its tool-call blocks) tool/result -> role tool, paired by toolCallId `tool/call` records duplicate the assistant message's own tool-call blocks one-for-one (206 of 206 call ids on a real session), so a call is only imported from that record when no assistant message carried it. Everything else is bookkeeping: `system/message` (instructions and compaction context), `reasoning` blocks, step/turn boundaries, approvals, sandbox mode, jobs, todo writes, slash-command output and delivery receipts. `agent/inbox/spliced` replays a `user/message` recorded separately under the same id. A newer session `version` still imports the records it understands and warns, so a future dsh release degrades to "some records skipped" instead of a silently partial session. Every unknown event type warns once per session, which is how the known-skip list above was completed: 26 real sessions on a development machine import with zero warnings. `ResolveEvt(dsh)` reads `<DSH_HOME>/.env`, the dotenv file `evercli plugin install dsh` already writes, so `run` works as well as `scan`. github.com/klauspost/compress was already in the module graph as an indirect dependency; it is promoted to a direct one at the same version, with no bump.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
evercli import conversationshad no reader for DeepSeek Harness, even thoughdshis already an install target — so the only EverMe memory a dsh user could get was what the native plugin captured after install, never the history that made the agent worth talking to. This adds the reader, the scan root, and the token resolver, soscanandrunboth work.Changes
cli/internal/importer/conversation/dsh.go— the scanner. DSH keeps one zstd-compressed JSONL log per session at<DSH_HOME>/sessions/<workspace>/<session-id>/session.v4.jsonl.zstd; the reader streams it throughzstd.Readerand maps the event-sourced records onto the existingAgentMemoryMessageDTO.cli/internal/importer/conversation/types.go,platforms.go,registry.go— registerdsh: platform id, known-platform set, default registry, andDefaultRoots(<DSH_HOME>/sessions, honoring the sameDSH_HOMEthe installer uses). The two "Use one of: …" hints incli/cmd/imports/conversations.gonow list it too.cli/internal/importer/conversation/evt.go—ResolveEvt(dsh)reads<DSH_HOME>/.env, the dotenv fileevercli plugin install dshalready writes, sorunresolves a token exactly like Claude Code / Hermes / Kimi Code do.cli/internal/importer/conversation/dsh_test.go— six test functions covering the record mapping, duplicate suppression, standalone tool calls, format-version drift, missing root, and token resolution. Fixtures are generated int.TempDir()with the zstd writer, so no binary blob is committed.cli/go.mod—github.com/klauspost/compresswas already in the module graph as an indirect dependency; it is promoted to a direct one at the same version (no bump).CHANGELOG.md.What gets imported
user/messageuser; text blocks joined,imageblocks skipped (the text still carries the question)assistant/messageassistant; text plus thetool-callblocks the message carries, attached astoolCallsso a call stays next to what asked for ittool/resulttool, paired bytoolCallId;isErrorresults are prefixed[error]tool/callcallId— the record duplicates the message's own block one-for-one (206 of 206 ids on a real session), so importing both would double-write every round-tripsystem/message,reasoningblocksagent/inbox/spliceduser/messagerecorded separately under the same id (11/11 ids on a real session)A session whose header
versionis newer than the v4 this reader knows still imports the records it understands and adds a warning, so a future dsh release degrades to "some records skipped" rather than a silently partial conversation. Every unknown event type warns once per session — that is how the skip list above was completed (first run of the reader surfaced 14 types I had not seen).Test Plan
go1.27.4, linux/amd64, commit
3e345b7:Manual verification against real session logs on a development machine (read locally;
scanuploads nothing):cli/changedplugins/changed — not applicable, this PR does not touchplugins/tool/callrecords 1:1Security
emk_*,evt_*, cookies, private URLs, or production logs are included. Test fixtures are synthetic; the end-to-end check above only counted messages locally and uploaded nothing.Known limitation (worth a reviewer decision)
DSH's
session.v4is a versioned internal format. The reader treats it defensively (version warning + per-type warnings + tolerant parsing) but it is still coupled to that schema. If maintainers would rather wait for a stable format, this PR can sit until then — the scanner is isolated in one file and registers nothing else.Related Issues
evercli plugin install dsh, in the same shape as the SeekMoon importer.