Skip to content

Add Zep memory plugin for DeepSeek Harness - #603

Open
danielchalef wants to merge 3 commits into
mainfrom
cursor/deepseek-harness-memory-775b
Open

Add Zep memory plugin for DeepSeek Harness#603
danielchalef wants to merge 3 commits into
mainfrom
cursor/deepseek-harness-memory-775b

Conversation

@danielchalef

@danielchalef danielchalef commented Aug 13, 2026

Copy link
Copy Markdown
Member

Summary

Adds @getzep/zep-deepseek-harness, a Zep long-term memory plugin for DeepSeek Harness, at integrations/deepseek-harness/typescript/.

The plugin uses the Harness's own extension points rather than wrapping the model call:

  • Recallagent/pre-step fetches the user's Zep Context Block on genuine user turns and folds it into the step as a source-attributed user/message. Harness requires all model-visible input to be reconstructable from the session log, so injecting into the request directly would break that invariant.
  • Persistence — a session/event listener writes direct user text plus the final assistant text once per successful turn, excluding injected context, tool results, and intermediate tool-call preambles.
  • Provisioning — Zep user and thread resources are created lazily and idempotently, with each Harness session mapped to its own thread under one user graph.
  • Failure handling — Zep errors are logged without conversation content and never stop the agent loop.

The package ships as an installable Harness bundle (dsh.bundle.patch), so dsh plugin --profile <name> add activates its Cordis row directly.

Testing

  • npm run lint
  • npm run typecheck
  • npm test — 7 tests covering provisioning idempotency, multi-step turn persistence, duplicate turn/end protection, fail-open recall, template validation, injected-context provenance, and the Harness namespace-plugin export shape
  • npm run build
  • npm pack --dry-run

Notes for reviewers

  • Two published DeepSeek package families exist on npm; the coordinated 0.1.0-rc.6 set is required because peer ranges across the 0.0.1-rc.1 tags conflict. Node 20 is excluded from this package's CI matrix since Harness requires Node ^22.19 || >=24.
  • DeepSeek Harness is in developer preview and expects breaking plugin API changes, so the dependency range is pinned to the tested release candidates.
  • Harness also supports memory over MCP via @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.
Open in Web Open in Cursor 

cursoragent and others added 3 commits August 13, 2026 14:30
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>
@socket-security

Copy link
Copy Markdown

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.

Action Severity Alert  (click "▶" to expand/collapse)
Warn Medium
Low adoption: npm @deepseek-ai/cordis

Location: Package overview

From: integrations/deepseek-harness/typescript/package-lock.jsonnpm/@deepseek-ai/cordis@4.0.1

ℹ Read more on: This package | This alert | What are unpopular packages?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Unpopular packages may have less maintenance and contain other problems.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/@deepseek-ai/cordis@4.0.1. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Warn Medium
Low adoption: npm @deepseek-ai/dsh-agent

Location: Package overview

From: integrations/deepseek-harness/typescript/package-lock.jsonnpm/@deepseek-ai/dsh-agent@0.1.0-rc.6

ℹ Read more on: This package | This alert | What are unpopular packages?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Unpopular packages may have less maintenance and contain other problems.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/@deepseek-ai/dsh-agent@0.1.0-rc.6. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Warn Medium
Low adoption: npm @deepseek-ai/dsh-attachment

Location: Package overview

From: integrations/deepseek-harness/typescript/package-lock.jsonnpm/@deepseek-ai/dsh-llm@0.1.0-rc.6npm/@deepseek-ai/dsh-attachment@0.1.0-rc.6

ℹ Read more on: This package | This alert | What are unpopular packages?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Unpopular packages may have less maintenance and contain other problems.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/@deepseek-ai/dsh-attachment@0.1.0-rc.6. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Warn Medium
Low adoption: npm @deepseek-ai/dsh-brand

Location: Package overview

From: integrations/deepseek-harness/typescript/package-lock.jsonnpm/@deepseek-ai/dsh-llm@0.1.0-rc.6npm/@deepseek-ai/dsh-session@0.1.0-rc.6npm/@deepseek-ai/dsh-brand@0.1.0-rc.6

ℹ Read more on: This package | This alert | What are unpopular packages?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Unpopular packages may have less maintenance and contain other problems.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/@deepseek-ai/dsh-brand@0.1.0-rc.6. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Warn Medium
Low adoption: npm @deepseek-ai/dsh-llm

Location: Package overview

From: integrations/deepseek-harness/typescript/package-lock.jsonnpm/@deepseek-ai/dsh-llm@0.1.0-rc.6

ℹ Read more on: This package | This alert | What are unpopular packages?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Unpopular packages may have less maintenance and contain other problems.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/@deepseek-ai/dsh-llm@0.1.0-rc.6. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Warn Medium
Low adoption: npm @deepseek-ai/dsh-session

Location: Package overview

From: integrations/deepseek-harness/typescript/package-lock.jsonnpm/@deepseek-ai/dsh-session@0.1.0-rc.6

ℹ Read more on: This package | This alert | What are unpopular packages?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Unpopular packages may have less maintenance and contain other problems.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/@deepseek-ai/dsh-session@0.1.0-rc.6. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Warn Medium
Low adoption: npm @deepseek-ai/dsh-system-prompt

Location: Package overview

From: integrations/deepseek-harness/typescript/package-lock.jsonnpm/@deepseek-ai/dsh-agent@0.1.0-rc.6npm/@deepseek-ai/dsh-system-prompt@0.1.0-rc.6

ℹ Read more on: This package | This alert | What are unpopular packages?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Unpopular packages may have less maintenance and contain other problems.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/@deepseek-ai/dsh-system-prompt@0.1.0-rc.6. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Warn Medium
Low adoption: npm @deepseek-ai/dsh-typert-protocol

Location: Package overview

From: integrations/deepseek-harness/typescript/package-lock.jsonnpm/@deepseek-ai/dsh-agent@0.1.0-rc.6npm/@deepseek-ai/dsh-session@0.1.0-rc.6npm/@deepseek-ai/dsh-typert-protocol@0.1.0-rc.6

ℹ Read more on: This package | This alert | What are unpopular packages?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Unpopular packages may have less maintenance and contain other problems.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/@deepseek-ai/dsh-typert-protocol@0.1.0-rc.6. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Warn Medium
Low adoption: npm @deepseek-ai/schemastery

Location: Package overview

From: integrations/deepseek-harness/typescript/package-lock.jsonnpm/@deepseek-ai/schemastery@3.18.1

ℹ Read more on: This package | This alert | What are unpopular packages?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Unpopular packages may have less maintenance and contain other problems.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/@deepseek-ai/schemastery@3.18.1. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

View full report

@danielchalef
danielchalef marked this pull request as ready for review August 13, 2026 14:37

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Critical — integrations/deepseek-harness/typescript/src/index.ts:34: userId is fixed for the entire plugin instance, so every Harness session shares one Zep user graph. SETUP.md explicitly suggests installing this configuration in the web profile, 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 requested turn/start through the end of the session rather than stopping at that turn’s turn/end or the next turn/start. If an older turn/end is replayed or persistTurn() 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 before persistTurn() succeeds. Since persistTurn() 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, with persistTurn() returning success, while separately tracking in-flight turns to prevent concurrent duplicates.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants