Skip to main content

deepseek-harness-local/integrations/deepseek-harness-local

6Stars0Forks0Issues0Watchers

Connect each human-machine turn from DeepSeek Harness to a local TMCRA memory service. Retrieve relevant evidence first, then inject it. Store questions and answers by role, with automatic queue retry on write failure.

Evidence5/5methodologySourceInstallMaintenanceDSH versionSecurity scan
Machine-auditedInstall commandRepo verifieddsh-plugin topicLicenseREADMEAI wiki
Language
Python
License
Apache-2.0
Branch
main
agent-memoryai-agentsclaude-codecodex-plugincross-session-memorydeepseek-harnessdsh-pluginlocal-first

Install

cmdweb profile
$ dsh plugin --profile web add github:reshuibuduo/tmcra-memory#path:integrations/deepseek-harness-local

Run the command above in your terminal to install this plugin via the dsh CLI. You can switch Profile in the top-right corner. New to dsh? Read the beginner tutorial

Install via your agent

Install the DeepSeek Harness plugin reshuibuduo/tmcra-memory/integrations/deepseek-harness-local for me: review the repository at https://github.com/reshuibuduo/tmcra-memory first, then run the install command and verify the plugin loads successfully.

Paste this instruction to the DSH Web GUI assistant — it will install and verify for you.

One-sentence Positioning

Connects every human-AI turn accepted by the host in DeepSeek Harness to the TMCRA local-only memory service running on your computer — recalls relevant content from the local evidence base before the model thinks, then stores questions and answers separately by role, with automatic retry queuing on write failure.

Core Capabilities

  • Injects recall evidence at the very front of the agent/pre-step hook ({ prepend: true }) into the message list, passing it as plugin data with trust="untrusted" marking to avoid being treated as instructions
  • At the start of each turn, automatically retries outbox writes accumulated from the previous turn, clearing failed tasks from ~/.tmcra/integrations/outbox/*.json
  • Captures turn end in the session/event hook, writing to the database separately by three-level identity (agentPreset / subagent / agent), distinguishing primary from subagent
  • On write failure, atomically writes payload to local outbox file for automatic retry next turn; does not throw blocking errors to host, lets Harness continue by default
  • Project identity resolution: prioritizes reading .tmcra/project.json marker, otherwise falls back to git remote → git root → cwd path hash, ensuring writes to the same project bucket as Codex, Claude and other local integrations
  • Enforced loopback: baseUrl must be 127.0.0.1 / localhost / ::1 and cannot contain path / query / userinfo; any public address gets rejected by schema

Technical Implementation

  • Language: TypeScript (type: module, output dist/index.mjs)
  • Key Dependencies: @deepseek-ai/cordis (host service container), @deepseek-ai/dsh-agent (agent/pre-step / PreStepDecision types), @deepseek-ai/dsh-llm (createUserMessage injection for recall), @deepseek-ai/schemastery (config schema validation)
  • Architecture Pattern: Cordis function plugin, name = "tmcra-local-memory", inject = ["agents"]; uses ctx.on("agent/pre-step", ..., { prepend: true }) to prepend recall content to the end of messages before all downstream pre-step handlers; uses ctx.on("session/event") to listen for turn/end events for writeback; ctx.effect() wraps final cleanup of all in-flight writes. Shares loadConfig / rememberMessage / flushOutbox / resolveProject from integrations/local-agent-hooks/lib/local_memory.mjs, ensuring project identity, token validation, and loopback checks are completely consistent with Codex, Claude and other local TMCRA integrations
  • Entry File: integrations/deepseek-harness-local/src/index.ts (single file; side-effect logic also lives in apply(ctx, config))

Applicable Scenarios

Use when you already have a TMCRA local-only memory running (no public network, no TMCRA account or subscription required), but DeepSeek Harness's Agent doesn't have access to this memory by default. This plugin takes over Harness's pre-step and turn/end lifecycle, allowing the model to see relevant evidence you've accumulated in the past via Codex, Claude or other TMCRA integrations before each answer, and archives this Q&A by role. Typical use case is personal long-term project memory — when you switch between multiple AI coding tools, they all inject the same local evidence and write back the same answers, ending up with a continuous, cross-tool project history rather than starting from scratch with every new session.

Prerequisites & Compatibility

DependencyMin VersionDescription
TMCRA local runtimeAny version that produces ~/.tmcra/config/runtime/local-runtime.jsonDeployed via scripts/install-local.ps1 / .sh; this plugin doesn't bundle the runtime and throws "TMCRA local integration is not configured" without it
Shared integration config generatorintegrations/local-agent-hooks/scripts/configure.mjs --runtime-config …Provided by the local-agent-hooks subpackage in this monorepo; must run once before deploying the Harness plugin
DeepSeek Harness host0.1.0-rc.5+ (peerDependencies locked to <0.2)peerDependencies lists @deepseek-ai/cordis ^4.0.0 <5, @deepseek-ai/dsh-agent / dsh-llm / dsh-session ^0.1.0-rc.5 <0.2; testing and docs target 0.1.0-rc.6
Node.js`^22.19.0
Platform—Cross-platform; uses process.platform === "win32" in local-agent-hooks/lib/local_memory.mjs to distinguish Windows ACL from POSIX 0600/0700 permissions
Native modules—None; only Node built-ins node:crypto / node:fs/promises / node:http

Installation

dsh plugin --profile web add github:reshuibuduo/tmcra-memory#path:integrations/deepseek-harness-local

Configuration Options

ConfigTypeDescriptionDefault
configPathstringAbsolute path to TMCRA local integration config file; if not filled, reads ~/.tmcra/local-integration.json (can also be temporarily overridden via env var TMCRA_LOCAL_INTEGRATION_CONFIG)~/.tmcra/local-integration.json
projectIdstringForces project identity to a fixed string; if not filled, resolves from current cwd / git / markerAuto-resolved from cwd or git
recallFailureMode"raise" | "continue"Whether to directly throw error and abort Harness on recall stage error, or only log warn and continue (writes proceed as normal)continue
recallTimeoutMsnumber (ms)Maximum allowed duration for a single recall request; actually clamped to 1000–180000ms120000
ingestTimeoutMsnumber (ms)Maximum allowed duration for a single recall/write request; also clamped to 1000–180000ms120000

FAQ

Q: Model responses became slower after enabling. What should I do?

A: Recall blocks before the model's first inference. Two common causes: TMCRA local service responding slowly, or recall hitting content too large and getting truncated to 24000 characters. You can first lower topK in ~/.tmcra/local-integration.json (default 8, min 1, max 32), then consider reducing recallTimeoutMs to let Harness take the "timeout-give-up-recall" fast path.

Q: I don't want the model to see historical evidence for a certain project. How to disable it?

A: Placing an empty .tmcra/project.json in that repository root won't work; the correct approach is to create a separate dsh profile for that project, set recallFailureMode to raise in cordis.patch.yml, and point configPath to a config file that intentionally can't be read — this way Harness will directly error and abort during pre-step, preventing any content from being injected.

Q: How to uninstall? How to completely clear local memory?

A: Uninstall via dsh plugin --profile web remove <name>; this plugin has no built-in persistent data. All data writes to external TMCRA service, outbox, and token files — delete ~/.tmcra/ (note: this will also clear evidence from other local TMCRA integrations like Codex and Claude).

Q: Installation directory has spaces or Chinese characters; npm pack reports path errors after Harness starts. What now?

A: This is a known bug in Harness preview. case "$PACKAGE_DIRECTORY" in *[! -~]*|*' '*) in scripts/install-deepseek-harness-local.sh actively detects and errors out; the fix is to change TMCRA_DSH_PACKAGE_DIRECTORY to a short ASCII path without spaces (e.g., D:\tmcra-packages or ~/.tmcra/packages).

Q: Error "TMCRA local hooks refuse non-loopback API URLs" — why?

A: Because validateLoopbackBaseUrl requires baseUrl to be 127.0.0.1 / localhost / ::1, protocol must be http: / https:, and cannot contain path / query / userinfo. This is to prevent token files from accidentally being sent to non-local services. If you want to connect to another machine's TMCRA on LAN, that TMCRA service must also be configured to restrict to loopback to work with this plugin.

Q: Can primary agent's recalled evidence be seen by subagents?

A: This implementation doesn't directly handle cross-subagent recall isolation. Each recall is triggered by its own agent/pre-step turn; when subagent triggers, session.header.origin === "subagent" and parent_session_id are recorded separately, so the write side can distinguish primary/subagent; however, recall's visibility scope currently depends on what the TMCRA server returns by project_id, with no client-side secondary filtering.

Q: No TMCRA runtime but plugin already added to profile. What happens?

A: Each human-AI turn accepted by Harness, the pre-step hook throws TMCRA local integration is not configured: /home/.../.tmcra/local-integration.json during the loadConfig await; since default recallFailureMode === "continue", the error is swallowed by warn(ctx, "prepare", error), writes are skipped, Harness continues. This turn has neither recall injection nor any messages written to the database — need to start TMCRA locally first and open a new session to backfill history.

Difficulty Level

Advanced — must first have an external TMCRA local runtime, have run the shared config generator once, understand the semantics of distinguishing pre-step / turn/end lifecycle hooks, and have basic familiarity with the schema and outbox paths in ~/.tmcra/local-integration.json.

Known Issues & Limitations

  • Harness preview cannot correctly handle spaces or non-ASCII characters in tarball paths; install script actively rejects and provides error message (README.md:26 / scripts/install-deepseek-harness-local.sh:13-19)
  • baseUrl schema hard-limited to loopback + no path + no query + no userinfo; any LAN IP or public address throws error directly (lib/local_memory.mjs:104-117)
  • recallFailureMode defaults to "continue", when TMCRA service is unavailable long-term, only warns in logs, host continues but current turn neither recalls nor writes (src/index.ts:228 / src/index.ts:237-239)
  • flushOutbox retries max 8 items at a time (MAX_OUTBOX_BATCH = 8), and uses "break on any file failure" strategy when iterating outbox files; when TMCRA service remains unavailable, new writes from this turn all stay in outbox waiting for next turn (lib/local_memory.mjs:12 / lib/local_memory.mjs:321-336)
  • recallTimeoutMs and ingestTimeoutMs schema forces clamping to 1000–180000ms, out of range throws timeout must be between 1000 and 180000 ms (src/index.ts:102-108)
  • Deployed TMCRA integration config schemaVersion must be 1, otherwise throws unsupported schema (lib/local_memory.mjs:137-139)
  • While recalled evidence in source code declares "current request takes priority when conflicting with current request," there is no runtime mechanism preventing the model from treating it as instructions — schema serves only as a hint

Read the usage guide →

Install steps, key points, FAQ and compatibility for this plugin — auto-derived from indexed fields.

Listing badge

Listed on deepseek-plugin.org
[![Listed on deepseek-plugin.org](https://img.shields.io/badge/listed_on-deepseek--plugin.org-007EC6)](https://deepseek-plugin.org/plugins/reshuibuduo/tmcra-memory/integrations/deepseek-harness-local)

Paste this markdown into your GitHub README to link back to this listing. The badge only states the listing — not a security endorsement.

← Back to plugin directory