Add Zep memory plugin for DeepSeek Harness - #603
Conversation
Co-authored-by: Daniel Chalef <danielchalef@users.noreply.github.com>
Co-authored-by: Daniel Chalef <danielchalef@users.noreply.github.com>
Co-authored-by: Daniel Chalef <danielchalef@users.noreply.github.com>
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub. |
|
Warning Review the following alerts detected in dependencies. According to your organization's Security Policy, it is recommended to resolve "Warn" alerts. Learn more about Socket for GitHub.
|
There was a problem hiding this comment.
-
Critical —
integrations/deepseek-harness/typescript/src/index.ts:34:userIdis fixed for the entire plugin instance, so every Harness session shares one Zep user graph.SETUP.mdexplicitly suggests installing this configuration in thewebprofile, where multiple humans may be served. Their conversations can therefore be persisted into and recalled from the same graph, causing cross-user memory and PII disclosure. Require per-session identity resolution for multi-user profiles, or restrict and clearly document this plugin as single-user only. -
Warning —
integrations/deepseek-harness/typescript/src/index.ts:135:completedTurn()slices from the requestedturn/startthrough the end of the session rather than stopping at that turn’sturn/endor the nextturn/start. If an olderturn/endis replayed orpersistTurn()runs after later events have accumulated, user messages from subsequent turns are written into the earlier turn’s Zep batch. Bound the event slice to the requested turn and add a multi-turn test. -
Warning —
integrations/deepseek-harness/typescript/src/index.ts:394: A turn is marked persisted beforepersistTurn()succeeds. SincepersistTurn()catches Zep failures internally, a transient failure permanently suppresses duplicate-event retries and silently loses the turn. Record the turn only after a successful write, withpersistTurn()returning success, while separately tracking in-flight turns to prevent concurrent duplicates.
Summary
Adds
@getzep/zep-deepseek-harness, a Zep long-term memory plugin for DeepSeek Harness, atintegrations/deepseek-harness/typescript/.The plugin uses the Harness's own extension points rather than wrapping the model call:
agent/pre-stepfetches the user's Zep Context Block on genuine user turns and folds it into the step as a source-attributeduser/message. Harness requires all model-visible input to be reconstructable from the session log, so injecting into the request directly would break that invariant.session/eventlistener writes direct user text plus the final assistant text once per successful turn, excluding injected context, tool results, and intermediate tool-call preambles.The package ships as an installable Harness bundle (
dsh.bundle.patch), sodsh plugin --profile <name> addactivates its Cordis row directly.Testing
npm run lintnpm run typechecknpm test— 7 tests covering provisioning idempotency, multi-step turn persistence, duplicateturn/endprotection, fail-open recall, template validation, injected-context provenance, and the Harness namespace-plugin export shapenpm run buildnpm pack --dry-runNotes for reviewers
0.1.0-rc.6set is required because peer ranges across the0.0.1-rc.1tags conflict. Node 20 is excluded from this package's CI matrix since Harness requires Node^22.19 || >=24.@deepseek-ai/dsh-mcp-client. This native plugin is the complement to that path: it guarantees per-turn context and durable session provenance instead of leaving recall to model tool choice.