DeepSeek Harness Plugin Hub

发布与管理完整 Harness Profiles,发现适合你的插件。

探索

插件目录环境预设文档中心动态

社区

发布插件联系我们报告问题

相关链接

Plugin Hub GitHubDeepSeek Harness 官方项目系统状态隐私说明
© 2026 DeepSeek Harness Plugin HubPowered byPaxTech

独立、非官方社区项目,与 DeepSeek 官方无隶属、授权或背书关系。

Session Rollover — DeepSeek Harness 插件(DSH Plugin)
DeepSeek Harness Plugin Hub
ProfilesPlugins分类动态文档登录管理 Profiles
ProfilesPlugins分类动态文档登录
← Plugins
S

dsh-session-rollover

Session Rollover

为长期运行的 DeepSeek Harness 代理自动切换到全新会话

插件会安装到这里;不确定时保持 web。

npx -y @deepseek-ai/dsh plugin --profile web add github:terryvanke/dsh-session-rollover#1873e53cc7aecf89f3f245353baefe33971ef5c4
README兼容性版本

兼容性与来源证明

Session Rollover 以 dsh-session-rollover 发布,当前版本为 0.1.0。Plugin Hub 会校验它的 manifest,并保存精确安装来源,便于复现安装结果。

DSH 兼容范围
*
运行环境
any
发布来源
github
Registry 更新时间
2026/9/24

版本

0.1.0stable
2026/9/24

相关插件

正在加载相关插件…

最新版
0.1.0
DSH
*
HMR
重启进程
Tree shaking
未声明可安全裁剪
解包体积
未提供
文件数
未提供
Surface
any
许可证
MIT
发布源
github
GitHub
★ 0
周下载
0
最近提交
2026/9/24
查看源码 ↗
README Badge

点击下方 Badge 复制 Markdown,粘贴到 README 即可。

这是你的 Plugin?认领权益 · 优先安全扫描

验证 package.json 声明的 GitHub 仓库,即可管理这个公开页面。认领后,Hub 会优先安排当前版本的安全扫描,并在通过后公开展示结果。

认领这个 Plugin →
报告问题

相关插件

继续浏览 agents-orchestration 分类下经过校验的插件。

Headless@deepseek-ai/dsh-headlessdsh one-shot bundle:基于 dsh-base 的直接核心 Agent/Session 运行器,不包含 Host、HTTP 或浏览器层Experimental Agent Team Profile@deepseek-ai/dsh-experimental-agent-team-profile在一个实验性捆绑包中提供 Agent Teams 协作、工具和 Web UIExperimental Agent Team Web Profile@deepseek-ai/dsh-experimental-agent-team-web-profile用于 Agent Teams Remote 和 UI 插件的实验性 Web 配置层Subagent Codex@deepseek-ai/dsh-subagent-codex基于官方 app-server 协议的一次性 Codex 子代理提供程序

README

dsh-session-rollover

English | 简体中文

Automatic session handoff for long-running DeepSeek Harness agents.

Fresh-session task handoff for DeepSeek Harness 0.1.7-rc.1. It creates a new session before context pressure exhausts the model window, stores a task checkpoint as Markdown and JSON, and queues continuation on the new agent. The existing workspace remains the source of truth.

This is an independent community plugin, not an official DeepSeek component. It works with models routed through DSH when the provider exposes a usable context window. GLM-5.1 with a 200K window is the default scenario; other model routes should report their actual window or set the fallback capacity explicitly. It is not a universal adapter for models outside DSH.

Features

  • Checks token pressure before each agent request and hands off before the configured hard limit.
  • Writes durable Markdown and JSON checkpoints and resumes in a fresh session without copying old chat history.
  • Preserves the workspace, selected model, and named permission preset where the host API supports them.
  • Recovers interrupted rollover transactions after restart and cooperates with official compaction.
  • Falls back to a deterministic checkpoint if optional LLM refinement fails.

Why

Normal compaction reduces old conversation history inside the same session. A long coding task can still accumulate repeated compactions, large tool results, or overflow. This plugin adds a distinct session boundary while preserving a durable chain.

Architecture and flow

ContextMonitor → RolloverPolicy → CheckpointGenerator → CheckpointStore → SessionRolloverManager → FreshSessionCreator → CheckpointInjector → AutoResumeManager

At agent/pre-step, the official token meter measures the durable request surface. The plugin adds newly claimed messages and applies soft and hard thresholds. The hard limit is min(floor(window × hardRatio), window − outputReserve − safetyReserve). At the hard limit, the old request is rejected. A per-session lock admits one transaction. A deterministic checkpoint is written first; optional LLM refinement follows. After atomic file writes, Web uses its public sessionController.create() path, which internally composes the preset and calls ctx.agents.create(). Other runtimes use ctx.agents.create() directly. Neither path seeds old history. The new agent receives the checkpoint via inject() and continuation via followup(). agent/request-error triggers emergency handoff on context overflow. The official compaction plugin remains in place.

Transaction states are NORMAL, ARMED, CHECKPOINTING, ROLLOVER_PENDING, CREATING_SESSION, RESUMING, COMPLETED, FAILED, and EMERGENCY_ROLLOVER. A saved transaction ID and preselected target session ID make restart recovery reuse the same identity.

Installation

Requires Node.js, pnpm, and a DSH 0.1.7-rc.1 runtime. Clone the repository, then run:

git clone https://github.com/terryvanke/dsh-session-rollover.git
cd dsh-session-rollover
pnpm install
pnpm run build
dsh plugin --profile web add .

If dsh is not on PATH, run the installed @deepseek-ai/dsh package's lib/bin.js with Node.js in place of dsh. The package declares dsh.bundle, so the profile adds its patch layer automatically. Inspect the effective configuration with dsh --profile web --dump-config. The installed Web profile must already be valid; fix unrelated invalid patch rows before booting. See the official bundle installation guide for profile details.

Configuration

The bundle enables the plugin with defaults. Override its row in the profile's cordis.patch.yml using the full config object; DSH patch replacement is not a deep merge.

FieldDefaultPurpose
enabledtrueEnable listener registration
context.windowTokens200000Fallback when adapter omits context capacity
context.softThresholdRatio0.65Arm rollover
context.hardThresholdRatio0.72Block old-session requests
context.reserveOutputTokens32000Fallback output reserve
context.safetyTokens24000Checkpoint and provider headroom
checkpoint.maxTokens8192LLM checkpoint output cap
checkpoint.includeRecentMessages12Deterministic recent user messages
checkpoint.includeToolResults8Deterministic recent tool results
checkpoint.retries3LLM checkpoint retries
rollover.maxRollovers100Chain cap
rollover.minIntervalSeconds60Soft-rollover spacing; hard/overflow override it
rolloverAfterCompactions0Optional soft-threshold compaction count
storage.directory.dsh/rolloverRelative to session workspace

Other fields are defined in src/config.ts: file and git inclusion, auto resume, workspace/model/preset metadata preservation, deterministic and overflow fallbacks, and notification logging.

GLM 200K recommendation

Keep the defaults for a 200,000-token route. The hard limit is 144,000 tokens with 32,000 reserved output tokens and 24,000 safety tokens. If your adapter advertises a different model context window or output cap, its metadata takes precedence. Set the GLM adapter's contextWindow to its actual capacity when available.

Checkpoints and crash recovery

Each workspace writes .dsh/rollover/<chain-id>/chain.json, plus session-001.md and session-001.json, etc. JSON stores lineage, original/current task, workspace state, files, progress, errors, decisions, the next action, and route metadata. Markdown is the model-facing handoff. Files are written to a temporary file, synced, and renamed. On restart, incomplete chain transactions are inspected; the stored target ID is resumed if persisted or created once if absent. The new agent is told to verify git status, git diff --stat, and referenced files before editing.

Compaction compatibility

Keep @deepseek-ai/dsh-compaction-basic mounted in the Agent preset. It runs at agent/pre-step, uses ctx.tokenMeter, and defaults to a 0.8 ratio capped by the model window minus routed output tokens and its 65,536-token headroom. On a 200K route this cap can make compaction run before rollover. The backend has its own bounded context-overflow recovery. This plugin observes completed compaction events for optional soft rollover; its hard safety threshold always wins.

Limitations

  • The public DSH 0.1.7-rc.1 API has no stable Web focus or user-toast API; V1 records a structured rollover notice in the host log and does not switch the browser tab automatically.
  • In Web, the public session controller composes the preset and model selection, and the permission preset service restores a named permission preset. Arbitrary custom Agent setup callbacks cannot be cloned; a custom permission state fails closed. An in-flight one-shot subagent run cannot be reattached to its parent tool result through the public Agent API; the plugin skips that session type and leaves official compaction in control. Such deployments need a dedicated subagent integration before unattended rollover.
  • The deterministic fallback reads recent events through Session.snapshotEvents(), which this DSH version marks deprecated. Migration to session-query is planned.
  • Restart recovery guarantees a stable target session ID. A crash after enqueueing continuation but before recording completion can re-enqueue the continuation. The filesystem check reduces duplicate work, but an exactly-once continuation queue requires a host-level transaction API.
  • The included E2E test uses a fake Agent and token pressure. It does not call a live GLM model.

Troubleshooting

If boot fails with patch: entry ... not found, inspect the Web profile's own cordis.patch.yml for an old row ID. If a plugin does not activate, verify dsh.bundle appears in package.json, then inspect dsh --profile web --dump-config. If a model has no declared context capacity, set context.windowTokens to the verified value. A failed session creation leaves the old agent intact and writes FAILED to the chain.

Development and testing

pnpm run typecheck
pnpm run lint
pnpm run test:unit
pnpm run test:e2e
pnpm run build

V2

Add host-supported session-chain UI and automatic focus, integrate preset setup composition, move fallback reads to the public query service, and add an exactly-once continuation marker if DSH exposes a transaction seam.

Contributing and license

Issues and pull requests are welcome. Run the checks in Development and testing before submitting a change. Released under the MIT License.