dsh-agent-sync: Mirroring WorkBuddy, ZCode, and Codex sessions into DSH

Introduction

When developing agents in DeepSeek Harness (DSH), tasks and sessions are typically concentrated on the Harness side; meanwhile, desktop or CLI coding assistants such as WorkBuddy, ZCode, and Codex leave independent session logs in their own directories on the local machine. When switching between the two sides, historical conversations often require manually cross-referencing paths or copy-pasting, making it difficult to continue conversations uniformly within DSH.

The community plugin dsh-agent-sync (repo JiangHuai24/dsh-agent-sync, maintained by JiangHuai24, category: workflow) does something different: it polls the session storage of locally installed applications, appends sealed conversation turns into DSH’s sessionPersistence, and attaches them to separate workspaces keyed by application name, forming readable, continuable mirrored tasks. Below we introduce its positioning, working method, installation, configuration, and usage notes.

What Is This

dsh-agent-sync is a DSH bundle plugin. After installation, the plugin row id is agent-sync, and configuration is written in cordis.patch.yml.

In one sentence: it mirrors sessions from other AI coding assistants on the local machine into DSH tasks in real time; each application is automatically assigned to its own workspace, with the workspace name being the application name.

The core problems it solves include:

  • Real-time: every time an external application produces a new conversation turn, it is appended to the corresponding DSH task within seconds;
  • Per-application: WorkBuddy, ZCode, Codex, etc. each have an independent workspace, without mixing;
  • Continuable: what gets mirrored are real DSH sessions, so you can directly continue asking within them;
  • Non-intrusive: once you take over a task within DSH, that source automatically stops syncing, so the two sides won’t overwrite each other.

The plugin is released under the MIT license; the current version in package.json is 1.9.2, requiring Node ≥ 22.13 (for development and testing scenarios).

How It Works

Data flows from each application’s local directory into an adapter, is split into turns, goes through the Harness’s own write path, and then is attached to workspaces by application. The diagram in the README is as follows:

WorkBuddy  ~/.workbuddy/projects/**/*.jsonl ─┐
ZCode      ~/.zcode/cli/db/db.sqlite        ─┼─▶ Adapter ─▶ Turn splitting ─▶ sessionPersistence
Codex      ~/.codex/sessions/**/*.jsonl     ─┘                           │
                                                                          ▼
                                        One workspace per app (title=app name)◀── attachSession

Three key design decisions deserve separate explanation:

  1. Only append sealed turns. A conversation turn is written only after “a next user message appears” or “silence exceeds sealAfterMs”; logs remain append-only and don’t need to be rewritten retroactively.
  2. Go through the Harness’s own write path. Data is persisted via sessionPersistence.create/append/flush and added to workspaces via Workspace.attachSession, rather than manually creating files or modifying workspace.json.
  3. Title events must reference messages. session/title events from non-user sources must include messageSeqs; otherwise the entire log will be judged as corrupt and unreadable — this is an implementation constraint emphasized in the plugin development documentation.

Core Features

Multi-Application Mirroring

The plugin ships with candidate data directories for 13 applications; it only takes effect for applications that actually exist and whose sessions can be scanned, and does not create empty workspaces. The ids and data sources listed in the README include (excerpt):

id App Data Source
workbuddy WorkBuddy ~/.workbuddy
zcode ZCode ~/.zcode/cli/db/db.sqlite
codex Codex ~/.codex/sessions
codebuddy CodeBuddy ~/.codebuddy etc.
cline Cline ~/.cline etc.

See the “Supported applications” section in the repo README for the complete table. Applications that are not installed will not produce any workspaces; if an application is installed but its storage format differs, the scanned value in the status file will show 0. TRAE is not in the supported range (related code removed since v1.9.2): its IDE sessions are stored in an encrypted local database, which cannot be mirrored.

  • Registers “Refresh task list” under sidebar.footer.action: clicking it reloads the page and fetches newly written sessions and titles (appending to existing tasks does not automatically trigger the sidebar list to redraw).
  • There is also “Search sessions” at the bottom of the sidebar (shortcut Ctrl/Cmd + K): you can find the session body by title or Harness message index keywords, and results are merged and deduplicated.

Settings and Status

“Settings → External session sync” displays the number of mirrored tasks, scan counts per application, error count, workspace root directory, etc. Data comes from the Host’s read-only interface /agent-sync/status.

For troubleshooting, you can check:

File Content
$DSH_HOME/storages/agent-sync/status.json Applications polled each time, scan counts, title/turn count/errors per source
$DSH_HOME/storages/agent-sync/state.json Mirror bookkeeping: id, number of synced turns, number of events, whether it has been taken over

Order: first check status.json’s apps[].error and sources[].error, then look at [agent-sync]-prefixed lines in the Host log.

Mirror Protection

Mirrored session logs live in DSH’s own directory and do not depend on whether the source application is still present. By default, no automatic archiving is performed (sweepMissing: false); after a source has been missing for more than orphanAfterMinutes (default 60 minutes), it is marked as orphaned. At plugin startup, state.json is snapshotted to backups/. Only when sweepMissing: true is explicitly set will the “archive when source disappears” behavior be restored.

Installation and Activation

The plugin is a DSH bundle. Install the repo directory via the plugin manager within Harness:

plugin_manager  action=install_bundle  target=<本仓库目录的绝对路径>

Or put it directly into the profile’s bundle list and install via the path for your current DSH version (README style: dsh plugin add <path>).

Before installation, you should read the repo source code and the MIT license yourself; the plugin runs with the current dsh process permissions and will read the data directories of various local assistants, so make sure the environment is trusted.

Community directory page (no official affiliation with DeepSeek / High-Flyer): skillhub.cn/plugins/JiangHuai24/dsh-agent-sync.

Configuration

Insert or modify the agent-sync row in cordis.patch.yml, e.g. the default snippet:

- insert:
    - id: agent-sync
      name: '@local/agent-sync'
      config:
        pollMs: 3000
        sealAfterMs: 12000
        maxSessionsPerApp: 0
        maxFilesPerApp: 4000
        scanEveryMs: 5000
        missingGraceMinutes: 30
        workspacesRoot: ''
        onlyApps: []

Meanings of commonly used keys (default values are as per the README):

Key Default Description
pollMs 3000 Polling interval (milliseconds), minimum 500
sealAfterMs 12000 How long of silence in a session before it is considered the end of a turn, minimum 1000
maxSessionsPerApp 0 Maximum number of sessions to sync per application, 0 = all
onlyApps [] Only sync these application ids
workspacesRoot empty Workspace root directory; if empty, uses agent-sync-workspaces under the default workspace parent directory

You can also configure stateFile (override the state file location) and apps.<id> per-application overrides (e.g. enabled: false, roots: [...]).

Typical Usage

Sync only WorkBuddy and ZCode, and place workspaces on a specified drive (README example):

config:
  onlyApps: ['workbuddy', 'zcode']
  workspacesRoot: 'D:\agent-sync-workspaces'

After the above steps and installing the bundle:

  1. Have conversations normally in the corresponding assistant, waiting for turns to be sealed (or the next user message triggering sealing).
  2. Return to DSH, and if necessary, click “Refresh task list” at the bottom of the sidebar.
  3. Open mirrored tasks in workspaces divided by application; if you want to continue the conversation within DSH, opening it counts as taking over, and that source stops syncing.

Use Cases and Notes

Who it’s for: developers who switch between multiple/multiple kinds of coding assistants and DSH, and want to aggregate external conversations locally into DSH tasks and continue them within Harness.

Known limitations (all from the README):

  • Read-only mirror: it does not write new conversations from DSH back to the original applications.
  • Take over to stop: after opening/continuing a mirrored task in DSH, that source stops syncing, to avoid two writers competing for the same log.
  • Text only: tool calls, images, and attachments are not mirrored; only user and assistant text is preserved.
  • Unverified formats: apart from WorkBuddy / ZCode / Codex, most other parsers are generic Claude-JSONL fallbacks and have not been verified against real data.

Conclusion

dsh-agent-sync uses append-only, sealed-turn syncing to bring local sessions from WorkBuddy, ZCode, Codex, etc. into DSH workspaces, and pairs with refresh, search, and status interfaces for daily use. Details and updates are as per the repo.

  • Directory page: https://www.skillhub.cn/plugins/JiangHuai24/dsh-agent-sync
  • GitHub: https://github.com/JiangHuai24/dsh-agent-sync
羽毛球分组比赛记分
小程序二维码

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

Xiaoye