Passer au contenu principal
J

dsh-codex-migrate-next

jichengkai/dsh-codex-migrate-next

Imports Codex CLI conversations, MCP servers, memories and project files into DeepSeek Harness as Session V4 transcripts, and moves a DSH conversation or project back into Codex. Maintained fork of dsh-codex-migrate for DSH 0.2.x; install it instead of, not alongside, the upstream package.

Installer

dsh plugin --profile web add github:jichengkai/dsh-codex-migrate-next

README

dsh-codex-migrate-next

dsh-codex-migrate banner

Predictable one-way structured migration between Codex and DeepSeek Harness

English · 中文

Fork notice. dsh-codex-migrate-next is a maintained fork of dsh-codex-migrate by nightcrusing (MIT), retargeted at DeepSeek Harness 0.2.x. Install either this package or the upstream one — never both: both register the same Codex migration service.

v2.0.5 — DeepSeek Harness 0.2.x

  • Session persistence targets the DSH Session V4 contract: settlement stream and turn/step fields, tool-call advertising before every tool/call, tool-role results, and interrupted Codex calls preserved as explicit failed results.
  • Peer dependencies and engines.dsh declare >=0.2.2-rc.2.
  • The settings panel's remote namespace mounts again (its Typert codec now supplies the create() factory the client registry requires); a failed mount reports its cause instead of an endless loading hint.
  • Panel language follows the DSH UI locale (language: auto); zh-CN/zh-Hans resolve to Chinese and existing en installs migrate once.

Version 2.0 turns the plugin into a two-sided migration bridge. Import Codex tasks into DSH, or move one DSH conversation—or every active conversation in a project—into Codex. Every action is an explicit one-time import; the source conversation is never modified later by background synchronization.

v2.0.4 compatibility update (upstream 2.0.4)

dsh-codex-migrate@2.0.4 carries the compatibility fixes introduced in v2.0.3 and is verified with the public npm @deepseek-ai/dsh@0.1.5-rc.2 (latest as checked on 2026-09-23). Those fixes address DSH's newer session persistence and Web client modules:

  • Codex → DSH: write valid Session V3 events through the lifecycle-scoped SessionHandle API, including flush/close, with a fallback for older persistence services.
  • DSH Web UI: update the client injection graph, use the active conversation's session ID for “Continue in Codex,” and keep large-history scans responsive with bounded metadata reads and asynchronous transcript reads.
  • DSH → Codex: open the imported task through the host operating system when a browser blocks codex:// navigation, while retaining browser navigation as a fallback.

The npm next and alpha DSH channels are not claimed as supported by this release. See the changelog for the release history.

What's new in v2.0

  • Two-way one-shot imports: Codex → DSH and DSH → Codex both convert history into the target's structured conversation format instead of flattening everything into plain text.
  • Continue in Codex: a native Codex action below DSH assistant replies imports the current conversation and opens the new Codex task.
  • Continue in DSH: the bundled MCP server and continue-in-dsh Skill let a Codex user say “Continue in DSH” to import and open the current task in DSH.
  • Batch migration by project: import every unarchived conversation in a DSH project in one operation while preserving the original workspace path.
  • Project-less Codex tasks: conversations without a Codex project are imported into the canonical (no project) / codex-unprojected workspace.
  • MCP memory Beta: remember_memory, search_memory, and forget_memory provide local persistent memories with global, project, and conversation scopes.
  • Three memory sources: independently import Codex Markdown memory, bridge MCP memory, and Memory Skill storage.
  • Faster inventory refreshes: an incremental cache reparses only new or changed files and isolates corrupted sessions.
  • Refined UI: simplified cards and lists, fixed live language switching, and consistent actions, badges, spacing, and dark/light styling.

Entry points

The Codex icon appears beside DSH's native copy and feedback actions:

Continue in Codex action in DSH
  • Select the Codex icon to import one DSH conversation and navigate to Codex.
  • Open Settings → Codex Migration → Batch Migration by Project to import every unarchived conversation in a project.
  • Say “Continue in DSH” in Codex to import the current Codex task and navigate to DSH.

Version 2.0 intentionally does not provide shared conversations, background bidirectional sync, conflict merging, or a Codex inline monitor. Each import is inspectable, repeatable, and cannot silently rewrite the same history on both sides.

Installation: configure both sides

The complete experience has two local components:

ComponentInstalled inPurpose
dsh-codex-migrate-nextDSHReads, converts, and creates DSH/Codex conversations; hosts the loopback-only handoff service
dsh-codex-bridge MCP + SkillCodexProvides “Continue in DSH,” MCP memory tools, and the trigger workflow

The DSH plugin alone supports settings-page imports and DSH → Codex actions. Install the Codex companion as well to start imports from Codex or use MCP memory.

Requirements

  • A working DeepSeek Harness installation.
  • Codex desktop, Codex CLI, or the Codex IDE extension.
  • node available in the terminal; Node.js 18 or newer is recommended.
  • Commands below use the DSH web profile. Replace web if you use another profile.

Step 1: install the DSH plugin

First installation:

dsh plugin add dsh-codex-migrate-next

Upgrade from an earlier version:

dsh plugin add dsh-codex-migrate-next

Restart DSH, then open Settings → Codex Migration. You should see Imported Conversations, Batch Migration by Project, and Memory Import.

Step 2: get the Codex companion

The MCP server and Skill are bundled in this repository, so keep the cloned directory available locally:

git clone https://github.com/jichengkai/dsh-codex-migrate-next.git
cd dsh-codex-migrate-next

If you already cloned the repository, update it with git pull.

Step 3: register the MCP server in Codex

Windows PowerShell:

$bridge = (Resolve-Path ".\codex\dsh-codex-bridge\mcp\server.mjs").Path
codex mcp add dshCodexBridge -- node $bridge --stdio

macOS / Linux:

bridge="$(pwd)/codex/dsh-codex-bridge/mcp/server.mjs"
codex mcp add dshCodexBridge -- node "$bridge" --stdio

If the same MCP name is already registered with an old path, run this first and then repeat the add command:

codex mcp remove dshCodexBridge

Verify the registration:

codex mcp list

Codex also supports direct ~/.codex/config.toml configuration, but the CLI avoids path and TOML escaping mistakes. See the official Codex MCP documentation.

Step 4: install the continue-in-dsh Skill

Windows PowerShell:

$skills = Join-Path $HOME ".agents\skills"
New-Item -ItemType Directory -Force -Path $skills | Out-Null
Copy-Item -Recurse -Force ".\codex\dsh-codex-bridge\skills\continue-in-dsh" $skills

macOS / Linux:

mkdir -p ~/.agents/skills
cp -R ./codex/dsh-codex-bridge/skills/continue-in-dsh ~/.agents/skills/

Codex discovers user skills in ~/.agents/skills. Restart Codex if an updated skill does not appear immediately. See the official Codex Skill documentation.

Step 5: restart and verify

  1. Start DSH with the migration plugin enabled.
  2. Restart Codex and confirm that dshCodexBridge is connected in /mcp.
  3. Confirm that continue-in-dsh appears in /skills.
  4. Create a test Codex task and enter: Continue in DSH.
  5. DSH should open the imported conversation. The Agent confirms with: 已同步对话到 DSH。

The MCP server exposes four tools:

ToolPurpose
continue_in_dshImport the current Codex task once and open DSH
remember_memorySave a local persistent memory
search_memorySearch memories in one scope
forget_memoryDelete a memory by ID

Quick MCP memory Beta test

  1. In one Codex task, ask: Use DSH MCP to remember that my test code is ocean-blue-728.
  2. Open another Codex task and ask: Search DSH MCP memory and tell me my test code.
  3. After it returns ocean-blue-728, ask it to forget that memory.

Memories are stored locally at ~/.codex/dsh-codex-bridge/memory.jsonl. They are not uploaded by this plugin and do not re-enable shared conversations.

Migrated content

ContentCodex → DSHDSH → Codex
User and assistant messages✓✓
Tool calls and tool results✓✓
Latest regenerated assistant reply✓✓
One conversation✓✓
Project-less conversations✓—
Batch import by project✓✓
AGENTS.md and project text filesOptional—
Codex / MCP / Memory Skill memoriesOptional—

DSH → Codex uses Codex's supported external-agent session import path. Every task in a project batch receives the same original working directory, while Codex remains responsible for sidebar organization.

Loading performance

The first refresh scans existing Codex sessions. Later refreshes reuse a size + mtime + hash incremental cache and parse only new or changed JSONL files. Removed files are dropped from the cache and corrupted files are isolated.

The cache lives under inventory/ in the migration output directory. Removing it only causes one full rebuild; it does not delete source conversations.

Key configuration

KeyDefaultMeaning
codexDir''Codex data directory; empty auto-detects ~/.codex
outputDir''Migration output; empty uses <DSH_HOME>/codex-sync
languageenen, zh, or auto to follow the UI locale
sessionModenewall, new, or selected
projectModeallall or selected
includeMemoriestrueImport Codex Markdown memory
includeMcpMemoriestrueImport bridge MCP persistent memory (Beta)
includeMemorySkilltrueImport Memory Skill storage
importAsDshSessionstrueCreate native DSH sidebar conversations
bridgeEnabledtrueEnable the loopback-only one-shot handoff service

Security boundary

  • The DSH handoff service binds only to 127.0.0.1.
  • Mutations require a generated installation token; the token is never stored in this repository.
  • Disabling the DSH plugin also stops the handoff service.
  • MCP memory stays local and does not automatically send raw project files or complete conversations to third-party services.
  • The plugin writes only to the configured outputDir, DSH session storage, and the local MCP memory file.

Development and release checks

npm run build
npm test
npm run test:bridge
npm pack --dry-run

See CHANGELOG.md for release history.

MIT

Plugins associés