@uu88s/dsh-session-handoff: Copy ID or handoff DSH session to codex resume

Preface

After running a long conversation in DSH, there are two common needs: paste the current session id to someone else or a script; or switch to the local codex CLI and continue with codex resume <id>. Simply copying the DSH session id is useless to codex — codex’s resume only recognizes records in its own session store. Manually cross-referencing logs, assembling rollout and index files is slow and prone to schema errors.

The following introduces the community plugin @uu88s/dsh-session-handoff (maintainer uu88s, SkillHub category “Memory”): it provides a copy-id and “hand off to codex” entry on the Web side, flattens the source session and writes it as a native record that codex can resume, and outputs a codex resume <new id> command.

What This Is

A DSH Web plugin that does two things:

  1. Copy session id: one-click copy of the DSH session id from the hover icon on the sidebar session row or the … menu.
  2. Hand off to codex: reads the entire DSH session (conversation text, tool calls, tool outputs, file change list), transcribes it into a session that codex can resume, writes it into the codex session store and registers the index, and finally provides a copyable resume command.

The handoff pipeline is summarized in the README as: read the source session → flatten into an intermediate representation → write as the target agent’s native record → register into the target index → produce resume credentials. v1 implements only codex; the reverse direction (importing external sessions into DSH) is handled by the official dsh-chat-import, which this plugin does not duplicate.

Source code and issue feedback: https://github.com/uu88s/dsh-session-handoff; directory page: https://www.skillhub.cn/plugins/uu88s/dsh-session-handoff.

Core Features

UI and Command Entries

Entry Location Action
Session row hover icon Right side of the sidebar session row Hand off to codex
Session row … menu Same as above ① Copy DSH session id ② Hand off to codex
Session header “Handoff” button Right of the session title Hand off to codex
/handoff command Input box [<sessionId>] [--dry-run] [--undo [--force]]
handoff_session tool Callable by the model {sessionId?, dryRun?, codexHome?}

Handoff uses a two-step approach: first a dry run (listing the rollout files to be created and the index rows to be inserted), then write only after confirmation. After completion, the Toast provides copy-resume-command, undo this handoff, and dismiss actions.

What Is Written and Fidelity (v1)

Content Transcribed?
User / assistant conversation text ✅ (two channels: model context + UI transcript)
History shown in the codex UI ✅ user / assistant messages; tool activity does not enter the UI
Tool calls (name + arguments; arguments truncated if over 2 KB with a note) ✅
Tool outputs (truncated if a single entry exceeds 8 KB, annotated with the original DSH session id) ✅
File change list (paths extracted from tool arguments) ✅
Reasoning / thinking process ❌
Attachment images, system prompt snapshots ❌ (attachments appear only as a placeholder line with an absolute path)

The handoff session’s cwd defaults to the source session’s cwd; originator is dsh-session-handoff, and cli_version is 0.1.0-dsh-handoff.

Snapshot Semantics

A handoff freezes the source session content at the moment of writing; if the DSH source session continues to grow afterwards, the codex target thread will not automatically sync. To include new content you must re-hand off, each time generating a new target session id without overwriting the old target (README test: handing off the same source session at different times produces different target ids and write sizes, and only the later handoff contains the new messages from after the first one).

Safety and Reversibility

  • Append-only, no overwrite: does not overwrite existing rollout files (flag: 'wx'), does not rewrite existing rows in the index.
  • Prechecks: validates the codex home directory, state_*.sqlite, threads table, and schema version, etc.; fails directly on error.
  • Reversible: deletes the rollout and the corresponding threads row created this time; records are appended to $DSH_HOME/session-handoff/handoffs.jsonl.

Installation and Activation

The plugin runs with the current DSH process’s permissions; before installing, it is recommended to review the repository source code and the MIT license. Requires DSH >=0.1.5-rc.1, Node >=22 (see package.json).

The README provides multiple installation methods; pick one:

# Follow main
dsh plugin --profile web add github:uu88s/dsh-session-handoff

# Pin a version tag
dsh plugin --profile web add github:uu88s/dsh-session-handoff#v0.1.0

# Source archive
dsh plugin --profile web add https://codeload.github.com/uu88s/dsh-session-handoff/tar.gz/refs/tags/v0.1.0

# Release asset
dsh plugin --profile web add https://github.com/uu88s/dsh-session-handoff/releases/download/v0.1.0/uu88s-dsh-session-handoff-0.1.0.tgz

After downloading and extracting, a local installation example:

curl -L -o handoff.tar.gz https://codeload.github.com/uu88s/dsh-session-handoff/tar.gz/refs/tags/v0.1.0
tar -xzf handoff.tar.gz
dsh plugin --profile web add /absolute/path/to/dsh-session-handoff-0.1.0

After installation, in the composition tree of dsh --profile web --dump-config you should see - id: session-handoff / name: '@uu88s/dsh-session-handoff'. Client-side changes can take effect without a refresh thanks to dsh-client-hmr; host-side JS changes require restarting DSH.

Typical Usage

  1. Open the session to be migrated in the Web sidebar, and initiate the handoff via the hover icon, the … menu, or the session header “Handoff” button; or run /handoff in the input box (add --dry-run to preview only).
  2. In the dry-run result, confirm the rollout and index rows to be written, then confirm writing.
  3. In the Toast, click copy to get a command like the following (<new id> is the codex thread id generated by the plugin):
codex resume <new id>

When you only need to copy the DSH id, use the copy item in the session row … menu; no handoff is needed.

The model side can also call handoff_session with parameters {sessionId?, dryRun?, codexHome?}.

Use Cases and Caveats

Suitable for: having accumulated long sessions in DSH Web and needing to continue with codex CLI under the same cwd; needing to carry the conversation, tool trace, and change paths into the codex model context rather than just recording a DSH id.

Caveats:

  • The target side must have a usable codex state store; if codex is holding the store you may encounter SQLITE_BUSY (the plugin’s precheck will probe this).
  • The UI transcript does not restore tool entries and reasoning, to avoid shape mismatches with codex TurnItem that would cause resume to crash; tool information stays in the model context channel.
  • After upgrading codex, re-verify with the repository’s test/probe-schema.mjs and test/probe-transcript.mjs (see README test notes); adaptations for zcode, codebuddy, etc. are in the v2 roadmap.
  • Undo does not touch the DSH source session, nor does it modify ~/.codex/session_index.jsonl (not the resume entry point).

The DeepSeek Harness community plugin directory is on SkillHub and has no official affiliation with DeepSeek / High-Flyer; installation and handoff behavior depend on your local DSH and codex environment.

Conclusion

@uu88s/dsh-session-handoff separates “copy the DSH session id” and “write a full codex-resumable session” into distinct entries, and uses dry-run, append-only writes, and reversibility to reduce the risk of mistakenly writing to the codex store. For plugin details and installation entries see the SkillHub directory page; implementation details and limitations are governed by the GitHub repository README.

羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye