dsh-curate: DSH Context Workbench for Manual Selection, Message Editing, and Range-based Compression

Preface

When running long sessions in DeepSeek Harness (DSH), the model-visible context keeps growing: tool outputs, injected runtime context, and multi-turn assistant replies pile up together. DSH’s built-in compaction-basic automatically compacts once a threshold is reached, which suits a “compact when it hits the threshold” workflow. But when you need to preserve a specific segment verbatim, fix an incorrect statement before compacting, or decide per turn that “keep this segment in full, keep only a summary for that segment,” the automatic policy often lacks the necessary granularity.

dsh-curate is a community plugin maintained by 111222cjyq, categorized under “Memory” in the SkillHub directory. It provides a human-driven context curation workbench: browse the session by turn, directly rewrite messages (without calling the model), mark messages as important/normal/minor to define compaction scope, and then have the model write a summary or use the official /compact after confirmation. Every write into the session is backed up locally as JSON first.

What Is This

In one sentence: dsh-curate is a human-in-the-loop context curation plugin for DSH—letting humans sort and edit text first, then compact session history in place, rather than deciding for the user what is important.

It does not replace compaction-basic, nor does it modify other plugins’ or profiles’ configurations; its positioning is “controllable compaction”: backup-able, edit-able, and able to preserve key segments verbatim.

Core Features

Workbench and Per-Turn Browsing

Click “Curate Context” in the session header to open the workbench in the right sidebar (use the right sidebar’s fullscreen mode if space is tight). The workbench slices the conversation currently visible to the model into cards by “turn”; the last message is always kept. Each card first shows a message preview; click “View Full Text” to see the rendered full content. The system prompt does not enter the workbench and remains read-only.

In-Place Message Editing (No Model Call)

User messages, assistant body and chain-of-thought, tool results, and injected context (including summary-style user/message and developer/message) are all editable. The editor supports source/render dual views; assistant replies can toggle blocks between “Body / Chain-of-thought”. Tool call arguments (tool-call.arguments) are structured JSON and remain read-only.

“Save Changes” in the editor only enters a staging area; clicking the bottom “Apply Changes to Context” or “Compact Modified Context” in the compaction flow is what actually writes into the session. User message rewrites go through the official surface replacement; assistant replies and the like go through plugin:dsh-curate/patch and message projection. When rewriting chain-of-thought, the original signature / thinkingSignature is stripped to avoid providers rejecting due to signature/text mismatch.

When editing text in messages with images/files, attachment blocks are preserved byte-for-byte; adding or removing attachments is not supported within the workbench.

Urgency Markers and Range-Based Compaction

Each visible message header has [Important][Normal][Minor]; the group header’s three buttons can batch-preset an entire turn, individual messages can override, and when the group is inconsistent the group header shows “Mixed”.

  • Important: This message’s original text is preserved and does not enter the compaction range.
  • Normal / Minor: Participate in compaction; when compacting, the model generates one summary per contiguous non-keep range (normal ranges get a regular summary, minor ranges get a shorter one).
  • The assistant’s tool-call and its corresponding tool/result are automatically grouped into the same urgency unit, preventing calls and results from being split apart.

“Keep Last N Turns” sets those turns to keep by default and can be manually changed back to normal/minor; trailing fixed messages are always keep.

The workbench top can toggle “All Content / Conversation Text Only” (only affects viewing and editing). There is also a checkbox “Summaries Only Read Conversation Text”: when enabled, summaries only read user/assistant text blocks, and tool outputs, injected context, and chain-of-thought do not enter the summary.

Compaction Methods

After clicking “Compact Context” at the bottom:

  1. Choose target: Compact Context Directly (ignore staged changes, clear staging after completion) or Compact Modified Context (apply staging first, then compact).
  2. Choose method: Compact by Curation Result (based on urgency markers, one write per range) or Official /compact (uses the official compaction backend in the current agent’s preset, scope decided by the official one, not by card markers).

Neither compaction method is reversible within the session; you must check the confirmation box before confirming. After compaction completes, the workbench re-reads and displays the result; the next model request only sees the curated context.

The original messages remain in the append-only session log, shadowed by surface replacement; every write is backed up locally first (default ~/.local/share/dsh-curate/backups/<sessionId>/, adjustable via environment variables DSH_CURATE_BACKUP_DIR and DSH_CURATE_BACKUP_KEEP).

Drafts and Other Operations

Urgency settings, view toggles, and staged changes are saved in a local draft (schema v4). “Save Current Content” only writes the local draft, not the session. “Undo” reverts the most recent urgency/edit/split change, and cannot restore already-applied changes or completed compactions.

The log leaves audit records: plugin:dsh-curate/edit-plan, edit-applied, plan, applied, compact, etc.

Installation and Activation

Environment requirements: Node.js ≥ 22; DSH 0.2.1-rc.x (the plugin declares engines.dsh >= 0.2.1-rc.2, peer @deepseek-ai/dsh-session ^0.2.1-rc.2). The current npm package version is 0.5.2 (MIT license).

Install from GitHub (lib/ is pre-built, no compilation needed at install time):

dsh plugin --profile web add github:111222cjyq/dsh-curate

Replace --profile per your environment (Web GUI defaults to web). Once published to npm, you can also:

dsh plugin --profile web add dsh-curate

After installation you must restart dsh web and hard-refresh the page; host plugins are loaded at startup, and the browser bundle needs to be refreshed to update.

Since 0.4.0, message editing is built-in and no longer depends on dsh-edit-turn; the two can coexist. “Compact by Curation Result” requires an available model: by default it prefers the provider/model of the session’s most recent request, and can also be specified in the profile’s plugin configuration, for example:

- id: dsh-curate
  config:
    provider: deepseek-official
    model: deepseek-v4-flash

If the model is unavailable, “Compact by Curation Result” returns 503; the official /compact is not affected by this provider/model setting.

Typical Usage

  1. Open any session and click “Curate Context” in the header.
  2. Expand “View Full Text” as needed, edit content via “Edit” on the message’s top-right corner, and “Save Changes” to stage; after all edits are done, click “Apply Changes to Context”, or leave them and select “Compact Modified Context” during compaction.
  3. Mark messages or entire turns as “Important / Normal / Minor”; check “Summaries Only Read Conversation Text” when you only want the conversation summarized.
  4. Click “Compact Context”, choose to compact directly or apply changes first, then choose “By Curation Result” or “Official /compact”, check the irreversible confirmation, and execute.
  5. Use “Save Current Content” to save the local draft; urgency or edit mistakes can be undone with “Undo” (except for changes and compactions already written into the session).

Editing and compaction are only available when the session is idle (no ongoing turn/compaction); if the session grows after the workbench was opened, you need to refresh and retry.

Use Cases and Notes

Who it’s for: DSH users and agent developers who need fine-grained control over long-session context, want to fix tool noise or incorrect statements before compaction, and want to preserve key answers verbatim while compacting intermediate segments.

Security and Permissions: The plugin runs with the current dsh process’s permissions, and backups contain full conversation originals (directory 0700, files 0600). Before installation, you should review the GitHub repository source code and LICENSE yourself. Routes only listen on loopback and validate Host and Origin.

Limitations: Applied changes and compactions cannot be undone within the session; compaction is rejected for the system prompt, the last message, boundaries that would split tool pairs, overlapping ranges, more than 200 blocks, etc. It does not perform semantic compaction on attachments; mathematical formulas are treated as plain text in render mode.

The DSH ecosystem emphasizes “everything is a plugin”; the SkillHub plugin directory is a community site with no official affiliation to DeepSeek / High-Flyer.

Closing

dsh-curate puts the decision of “what goes into the context and what gets summarized” into human hands: curate first, edit text, then compact, with a local backup before every write. If you are already using the DSH 0.2.1-rc.x Web interface, you can install it via the command above and try it after restarting.

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

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

Xiaoye