fix(python): mount session checkpoint policy

This commit is contained in:
Yichen Jiang
2026-07-21 15:23:45 +08:00
parent 6d12e3ab41
commit ddc1c66c03
16 changed files with 39 additions and 15 deletions

View File

@@ -2,5 +2,5 @@
# side as of the last confirmed-consistent state. Both languages carry equal authority;
# after editing either side, bring the other along and re-record with:
# pnpm run verify-translation-pairing --write
README.md: 5fd1bc7cd89152a28d3da17100fd62eed4f8cb14
README.zh.md: 247a2ca5ea5c1c3afc19335a6bbcba356c823211
README.md: 23d15d617b3d295a6cc2d8d20c6d03abc226834b
README.zh.md: 4f6aef13833af937babc2e5a92bfd14c12170534

View File

@@ -19,7 +19,7 @@ with DeepSeekHarness() as harness:
`DeepSeekHarness` keeps its lazily started runtime subprocess for reuse across calls. Use it as a context manager, as above, or call `close()` explicitly when finished.
By default, the SDK launches the bundled single-file `dsh-jsonrpc-agent` executable from the `deepseek-harness-runtime-bin` package and injects that package's default configuration (the stdio JSON-RPC server, agent core, preloaded DeepSeek adapter, JSONL session persistence, local bash) via `DSH_CORDIS_CONFIG`. To run a plugin composition of your own, keep the `@deepseek-ai/dsh-jsonrpc` entry in the config and pass the Cordis config path.
By default, the SDK launches the bundled single-file `dsh-jsonrpc-agent` executable from the `deepseek-harness-runtime-bin` package and injects that package's default configuration (the stdio JSON-RPC server, agent core, preloaded DeepSeek adapter, JSONL session persistence with an explicitly composed semantic checkpoint policy, local bash) via `DSH_CORDIS_CONFIG`. To run a plugin composition of your own, keep the `@deepseek-ai/dsh-jsonrpc` entry in the config and pass the Cordis config path.
```py
from deepseek_harness import DeepSeekHarness

View File

@@ -15,7 +15,7 @@ with DeepSeekHarness() as harness:
`DeepSeekHarness` 会保留延迟启动的运行时子进程,以供多次调用复用。请像上例一样将其用作上下文管理器,或在用完后显式调用 `close()`
默认情况下SDK 启动 `deepseek-harness-runtime-bin` 包内置的单文件 `dsh-jsonrpc-agent` 可执行程序,并通过 `DSH_CORDIS_CONFIG` 注入该包的默认配置stdio JSON-RPC 服务器、`agent-core`、预载的 DeepSeek 适配器、JSONL 会话持久化、本地 bash。要运行自己的插件组合请在配置里保留 `@deepseek-ai/dsh-jsonrpc` 条目,并传入 Cordis 配置路径。
默认情况下SDK 启动 `deepseek-harness-runtime-bin` 包内置的单文件 `dsh-jsonrpc-agent` 可执行程序,并通过 `DSH_CORDIS_CONFIG` 注入该包的默认配置stdio JSON-RPC 服务器、`agent-core`、预载的 DeepSeek 适配器、配有显式组合语义检查点策略的 JSONL 会话持久化、本地 bash。要运行自己的插件组合请在配置里保留 `@deepseek-ai/dsh-jsonrpc` 条目,并传入 Cordis 配置路径。
```py
from deepseek_harness import DeepSeekHarness

View File

@@ -28,6 +28,8 @@ _CORDIS_YML = """\
name: '@deepseek-ai/dsh-session-persistence-jsonl'
config:
root: './sessions'
- id: session-checkpoints
name: '@deepseek-ai/dsh-session-checkpoint-policy'
- id: bash
name: '@deepseek-ai/dsh-bash-local'
config:

View File

@@ -15,7 +15,10 @@ from deepseek_harness_runtime import (
def test_default_config_is_shipped_with_the_package() -> None:
path = bundled_default_config_path()
assert path == bundled_package_dir() / "runtime" / "cordis.yml"
assert "@deepseek-ai/dsh-agent-spine-demo" in path.read_text()
config = path.read_text()
assert "@deepseek-ai/dsh-agent-spine-demo" in config
assert "@deepseek-ai/dsh-session-persistence-jsonl" in config
assert "@deepseek-ai/dsh-session-checkpoint-policy" in config
def test_unknown_explicit_mode_fails_loud() -> None: