DeepSeek Harness Plugin Hub

Publish and manage complete Harness Profiles. Discover Plugins for your next setup.

Explore

PluginsPresetsDocsNews

Community

Publish a pluginContactReport an issue

Resources

Plugin Hub on GitHubDeepSeek HarnessSystem statusPrivacy notice
© 2026 DeepSeek Harness Plugin HubPowered byPaxTech

Independent and unofficial. Not affiliated with, authorized by, or endorsed by DeepSeek.

DeepSeek Harness Plugin Hub
ProfilesPluginsCategoriesNewsDocsSign inManage Profiles
ProfilesPluginsCategoriesNewsDocsSign in
← Plugins

dsh-token-optimizer

Token Optimizer

Deterministic, recoverable tool-result compression and cache-aware compaction for DeepSeek Harness

The plugin will be installed here. Keep web if you are unsure.

npx -y @deepseek-ai/dsh plugin --profile web add github:Snow-ea/dsh-token-optimizer#e4c4c825b7152b16610807107c272005a1ccebbb
READMECompatibilityVersions

Compatibility and provenance

Token Optimizer is published as dsh-token-optimizer and currently resolves to version 0.2.5. The Hub verifies its manifest and preserves the exact installation source for reproducible installs.

DSH compatibility
*
Runtime surfaces
web
Release source
github
Registry updated
11/5/2026

Versions

0.2.5stable
10/30/2026
0.2.4stable
10/17/2026
0.2.3stable
9/29/2026
Show 5 more versionsCollapse versions
0.2.2stable
9/25/2026
0.2.1stable
9/10/2026
0.2.0stable
9/3/2026
0.1.9stable
9/1/2026
0.1.8stable
8/30/2026

Related plugins

Loading related plugins…

Latest
0.2.5
DSH
*
HMR
Process restart
Tree shaking
Safe tree shaking not declared
Unpacked size
Unavailable
Files
Unavailable
Surface
web
License
MIT
Source
github
GitHub
★ 3
Weekly downloads
1,417
Last push
10/30/2026
View source ↗Project homepage ↗
README badge

Click the badge to copy Markdown for your README.

Do you maintain this Plugin?Claim benefit · Priority security scan

Verify the GitHub repository declared in package.json to manage this listing. After you claim it, Hub will prioritize a security scan of the current version and publish the result when it passes.

Claim this Plugin →
Report an issue

Related plugins

More verified plugins in models-usage.

Experimental Cot Translation Bundle@deepseek-ai/dsh-experimental-cot-translation-bundleExperimental machine translation of expanded reasoningWhale Widgetdsh-whale-widgetDeepSeek balance whale widget in the bottom-right corner of the DSH Web interface: balance/today’s usage/peak-off-peak pricing, customizable bubble click sequence (text/balance/today/peak-off-peak/image/random phrases and parallel weighted selection), per-line styles and fonts, floating quick editinOur Free Model@ebony-vinyl/dsh-our-free-modelOur Free Model — Install this plugin in dsh to use cutting-edge models including DeepSeek V4.1 Flash and Kimi K3, with no login, registration, or API Key required. The desktop version also offers an EAC co-payment channel; starting with 2.0, it supports ten account channels: LobsterAI, Qoder, TRAE, Usage@linxin666/dsh-usageUsage statistics plugin for the dsh web GUI: per-provider balance and coding-plan quota detection plus a live token usage ledger, with a compact price glance card above the sidebar's Settings row

README

dsh-token-optimizer

Deterministic, recoverable tool-result compression and cache-aware compaction for DeepSeek Harness 0.2.1-rc.5.

中文文档

What it does

  • Compresses large successful text tool results before they repeatedly enter the model context.
  • Compresses PTC sub-dispatch log copies without changing the complete structured values received by run_code programs.
  • Archives every lossy replacement and exposes retrieve_spill for exact, session-authorized recovery.
  • Provides a root-level BasicCompactionEngine adapter with a 62.5% default threshold while preserving DSH's cache-aware replay, branded Session API, and routed image accounting.
  • Adds a Web conversation dashboard through the split Conversation, Renderer, and Session client contracts.
  • Declares a localized title, description, and icon so Plugin Manager shows it as a first-class bundle.

Install

Install the 0.2.5 bundle into a DSH 0.2.1-rc.5 Web profile:

dsh plugin --profile web add dsh-token-optimizer@0.2.5

Restart the existing dsh web process after installation. The bundle enables recoverable tool-result compression, spill retrieval, projection, the Web dashboard, and the 62.5% automatic compaction engine across all four shipped agent modes. No user preset copy is required.

The root engine observes each agent's pressure and overflow lifecycle. In Standard, PTC, and Creator modes it runs before the isolated stock engine, so the surface is reduced at 62.5% and the stock 80% fallback has no second reduction to perform. Minimal mode has no preset compaction group and uses the root engine directly. The optional preset-cordis.yml fragment remains for deployments that deliberately want to replace a preset's isolated provider itself; do not edit shipped presets. DSH 0.2.1-rc.5 ships the four presets as extra patch layers inside its Web bundle, so a user-copied preset from an older DSH should be revalidated against the current composition before reuse.

DSH 0.2.1-rc.5 ships its own spill subsystem (dsh-spill-local plus dsh-spill-policy at maxInlineTokens: 12500). The optimizer keeps its durable archive as the retrieval authority and mirrors each replacement into that backend when it is present, so the two coexist without compressing the same result twice.

Since DSH 0.1.7-rc.1 the host checks a plugin's @deepseek-ai/dsh* peer ranges at startup. 0.2.0-rc.2 turned that check from fail-soft into fail-closed: a bundle whose ranges do not match the runtime is refused outright rather than disabled in place. This plugin declares >=0.1.5-rc.1 <0.3.0, so one release covers 0.1.5-rc.3 through 0.2.x while explicitly refusing the unaudited 0.3.0. The previous ^0.1.5-rc.1 range could not reach 0.2.0 — a caret on a 0.x version only authorises patch movement, which is why 0.2.2 is skipped on every 0.2.x runtime. 0.2.1-rc.2 adds an optional engines.dsh range that would take precedence over the peers when present; this plugin deliberately keeps the peer form, so exactly one requirement surface stays authoritative. See the 0.2.0-rc.2 peer-gate section and the 0.2.1-rc.2 gate section for the measured matrices.

Configuration

This plugin's early compaction is controlled by one boolean, compaction, which defaults to on:

# Turn the plugin's 62.5% early compaction off
- id: dsh-token-optimizer
  config:
    compaction: false

With it off, no root ctx.compaction provider and no pressure/overflow listener is registered, while tool-result compression, retrieve_spill, the session projection, and the dashboard all stay active. Three things to know:

  1. It disables this plugin's early compaction, not all compaction: the isolated stock engines shipped with Standard, PTC, and Creator still fall back at 80%, so you return to the DSH default you had before installing the plugin. Minimal has no compaction group and therefore no compaction at all once it is off.
  2. A profile patch replaces a plugin's whole config instead of deep-merging it. Every field left unwritten falls back to the value the shipped bundle sets, so a switch-only override is safe and a regression test locks that equivalence; write the other fields out when you also want to change them.
  3. With the switch off, non-Web profiles no longer need the compaction overlay described in the compatibility notes, because the root provider is never claimed. While the switch is on, that overlay is still required, and its absence fails loudly with service "compaction" has been registered at <BasicCompactionEngine> rather than degrading silently.

The threshold itself defaults to 0.625 and can be changed:

- id: dsh-token-optimizer
  config:
    thresholdRatio: 0.5
    retainRatio: 0.16

retainRatio must stay below thresholdRatio, or the upstream engine refuses to load.

Verify

pnpm install
pnpm run check
npm pack --dry-run

The current test suite covers deterministic compression, persistent recovery, session lineage authorization, compaction defaults, the compaction switch, DSH projection behavior, and real tool-runtime integration.

Compatibility

dsh-token-optimizerDeepSeek HarnessStatus
0.1.90.1.1-rc.2Superseded
0.2.00.1.2-rc.1Superseded
0.2.10.1.5-rc.1Superseded
0.2.20.1.5-rc.1 … 0.1.7-rc.2Superseded
0.2.30.1.5-rc.1 … 0.2.xSuperseded
0.2.40.1.5-rc.1 … 0.2.xSuperseded
0.2.50.1.5-rc.1 … 0.2.xCurrent release

0.2.0 removed the retired dsh-client-runtime dependency, uses the split Conversation/Renderer/Session client graph, folds projections through the on-demand Session log API, and handles PTC durable dispatch logs. See the 0.1.2-rc.1 compatibility research.

0.2.1 adapts to the SpillSource discriminated union that dsh-spill gained — tool producers must now declare kind: 'tool' — and raises every declared DSH range to 0.1.5-rc.1. No other plugin surface changed between the two releases. See the 0.1.5-rc.1 compatibility audit.

0.2.2 adapts to 0.1.7-rc.2: it follows the removal of the tool-result wrapper block, adopts the awaited agent/created contract, mirrors the new upstream headroomTokens field behind two compile-time drift assertions, and declares plugin metadata for Plugin Manager. The compaction switch can also now turn the plugin's early compaction off. It keeps supporting 0.1.5-rc.3, because the host's peer check accepts ^0.1.5-rc.1 for the whole 0.1.x line. See the 0.1.7-rc.2 compatibility audit.

0.2.4 adapts to 0.2.1-rc.2. No plugin-facing declaration changed in a way this plugin can observe, and no source line changed: thirteen of the sixteen audited packages differ at the .d.ts level, but every difference is additive, internal, or a doc-comment rewrite, the three core contract packages (dsh-compaction-basic, dsh-session-projection, dsh-spill) are byte-identical, and cordis 4.0.5 / schemastery 3.18.5 emit identical declarations. The release re-pins the tested closure and certifies compress → archive → retrieve on a real 0.2.1-rc.2 headless session. See the 0.2.1-rc.2 compatibility audit.

0.2.5 adapts to 0.2.1-rc.5. Fifteen of the sixteen audited packages are byte-identical at the .d.ts level; the only change is dsh-client-ui-conversation, and it is purely additive (View tabs and pins, the header More menu, draft handling, MessageSubmissionState.newSession/agentPreset), so no source line changed and all 24 tests pass on the real 0.2.1-rc.5 closure. The launcher's gate implementation is byte-identical to 0.2.1-rc.2, the existing >=0.1.5-rc.1 <0.3.0 peer window still loads through 0.2.1-rc.5 and still refuses 0.3.0, and a real headless 0.2.1-rc.5 session was certified end to end: a 34,532-character tool result compressed to a mode=large spill with a matching SHA-256 artifact, retrieve_spill recovered it in a later turn, and the tokenOptimizer projection folded the saving. See the 0.2.1-rc.5 compatibility audit.

0.2.3 adapts to 0.2.0-rc.2. No plugin-facing declaration changed in a way this plugin can observe — fourteen of the sixteen audited packages are byte-identical at the .d.ts level, and the two that moved (dsh-session's repair internals, dsh-client-ui-conversation's submission analytics) are outside its surface, so the 0.2.2 sources compile and all 24 tests pass unchanged. The release exists because the launcher's peer gate became fail-closed: the declared range moves to >=0.1.5-rc.1 <0.3.0, which is what keeps the bundle loading on 0.2.x while still covering 0.1.x. See the 0.2.0-rc.2 compatibility audit.

The DSH packages remain optional peer dependencies so the profile runtime supplies the matching services.

License

MIT