Minimal profiles use a bare runtime
minimal profile 使用裸运行时
The Web `minimal` preset and standalone JSON-RPC minimal composition exposed persistent `bash` and `str_replace_editor`, but their supporting services did not match the intended training runtime. Both mounted context compaction, while the Web preset inherited the host's sandboxed filesystem and the JSON-RPC composition mounted `fs-sandbox` plus filesystem policy. A long session could therefore replace history, and th
English
Problem
The Web minimal preset and standalone JSON-RPC minimal composition exposed persistent bash and str_replace_editor, but their supporting services did not match the intended training runtime. Both mounted context compaction, while the Web preset inherited the host's sandboxed filesystem and the JSON-RPC composition mounted fs-sandbox plus filesystem policy. A long session could therefore replace history, and the editor advertised and enforced a filesystem policy that the bare local reference runtime does not have.
The two launch paths also have different configuration owners. Web mounts a per-agent preset over a running host, while the Python SDK initializes a complete stdio JSON-RPC child process. Treating them as one interchangeable Cordis leaf would hide those lifecycle differences, and the SDK example had no environment path for selecting its model or system prompt.
Decision
The shipped Web minimal preset exposes persistent bash; the standalone profile exposes persistent bash on Linux/macOS or pwsh on Windows. Both mount no context-compaction or filesystem provider and suppress every dsh-system-prompt runtime-context contribution for fresh sessions. The persistent-shell-only decision removes the editor and its otherwise-unused fs-local provider from both compositions. The Web preset's persona remains the fixed complete prompt owned by the earlier minimal-preset composition decision and applies runtime-context suppression only to that agent scope. The standalone spine forwards the same setting to its process-owned system-prompt service. The Web host retains its sandbox and approval services; the standalone profile mounts a danger-full-access sandbox policy and no approval service. Neither contributes model-facing policy context.
The standalone @deepseek-ai/dsh-sdk-minimal bundle remains a complete JSON-RPC process composition behind dsh --profile sdk-minimal. It mounts SDK startup and JSON-RPC serving, the local PTY and subprocess services required by the platform-selected persistent shell, that shell's tool consumer, and uncompressed JSONL persistence under $DSH_HOME/sessions. It does not mount token-meter, compaction-basic, fs-local, fs-sandbox, fs-observation-policy, or a filesystem tool. The persistent shell consumes the profile's danger-full-access sandbox policy. docs/architecture.md owns this bundle placement and its separation from dsh-base.
DSH_SYSTEM_PROMPT selects the standalone persona, and DSH_CONTEXT_WINDOW supplies fallback capacity for a model without exact catalog metadata. The SDK client's JSON-RPC initialize request is the sole runtime model selection. minimal.py may read DSH_MODEL only as the command's default model argument; an explicit --model needs no matching child environment value. Endpoint and credential variables stay owned by the DeepSeek adapter's existing environment-resolution path.
Verification
The Web replay boots the complete Web host, creates the agent through the preset service, and asserts that no scoped filesystem or compaction service exists, no system-prompt-owned runtime-context message was appended, and the assembled request contains exactly the fixed prompt and persistent Bash. It then executes persistent Bash against the real scoped services.
The SDK keyless source test boots real dsh --profile sdk-minimal, completes a turn with an environment-selected prompt, and asserts the generated one-bundle manifest. The Python SDK bundled-runtime snapshot owns the assembled prompt, exact single-tool catalog, and absence of every system-prompt-owned runtime-context message. Packaged-runtime coverage initializes the standalone profile through each available carrier with environment-selected model, model capacity, and prompt values, then executes the selected persistent shell. Cordis validation checks that both configurations resolve their declared plugins and configuration fields.
Alternatives considered
Keep compaction-basic mounted with a high threshold. Rejected because even an inert-for-short-tests provider permits history replacement in longer sessions and leaves the minimal composition dependent on model-capacity metadata and the token meter.
Keep fs-local after removing the editor. Rejected because neither minimal composition has another filesystem consumer. Retaining the provider would increase the runtime roster without adding a model-visible capability.
Use one Cordis leaf for Web and Python SDK startup. Rejected because a Web preset contributes agent-scoped services to an existing multi-session host, while the Python SDK must launch a complete process containing the JSON-RPC server and its process-wide dependencies.
Mirror the requested model into DSH_MODEL. Rejected because the direct adapter accepts model ids outside its advisory catalog and resolves fallback context metadata for them. Mirroring creates two inputs for one selection; the SDK initialization request is authoritative, while DSH_MODEL remains only a convenience default in minimal.py.
Consequences
Minimal sessions never summarize or replace earlier history and never add a runtime-context snapshot; callers must keep turns within the selected model's context capacity and must not rely on model-visible narration of standing sandbox or approval policy. The two launch paths share their single-tool, no-filesystem, no-context, and no-compaction guarantees while retaining different prompt and model configuration appropriate to their owners. The Python SDK path communicates only through the bundled dsh stdio JSON-RPC profile.
中文
问题
Web minimal preset 与独立 JSON-RPC minimal 组合对外提供持久 bash 和 str_replace_editor,但支撑服务与目标训练运行时不一致。两者都挂载上下文压缩,而 Web preset 继承宿主的沙箱文件系统,JSON-RPC 组合则挂载 fs-sandbox 和文件系统策略。因此,长会话可能替换历史记录,编辑器也会宣告并实施裸本地参考运行时并不具备的文件系统策略。
两条启动路径的配置所有者也不同。Web 在已运行的宿主上挂载逐 agent preset,Python SDK 则初始化一个完整的 stdio JSON-RPC 子进程。将二者视为可互换的同一个 Cordis leaf 会掩盖生命周期差异,而且 SDK 示例没有通过环境选择模型或系统提示词的入口。
决策
随附 Web minimal preset 对外提供持久 bash;独立 profile 在 Linux/macOS 上提供持久 bash,在 Windows 上提供 pwsh。两者都不挂载上下文压缩或文件系统提供方,并为新建会话抑制每个 dsh-system-prompt runtime-context 贡献。仅持久 shell 决策从两份组合中移除了编辑器及其原本除此之外无人使用的 fs-local 提供方。Web preset 的 persona 继续采用较早的 minimal preset 组合决策所拥有的固定 complete 提示词,并仅为该 agent 作用域实施 runtime-context 抑制。独立 spine 将同一设置转发给其进程拥有的 system-prompt 服务。Web 宿主保留沙箱与批准服务;独立 profile 挂载 danger-full-access 沙箱策略,不挂载批准服务。两者都不贡献面向模型的策略上下文。
独立的 @deepseek-ai/dsh-sdk-minimal 组合包仍是 dsh --profile sdk-minimal 后面的完整 JSON-RPC 进程组合。它挂载 SDK 启动与 JSON-RPC 服务、按平台选择的持久 shell 所需的本地 PTY 和子进程服务、该 shell 的工具消费方,以及位于 $DSH_HOME/sessions 的未压缩 JSONL 持久化。它不挂载 token-meter、compaction-basic、fs-local、fs-sandbox、fs-observation-policy 或文件系统工具。持久 shell 消费该 profile 的 danger-full-access 沙箱策略。docs/architecture.md 负责该组合包的位置及其与 dsh-base 的分离。
DSH_SYSTEM_PROMPT 选择独立组合的 persona,DSH_CONTEXT_WINDOW 为没有确切目录元数据的模型提供后备容量。SDK 客户端的 JSON-RPC initialize 请求是唯一运行时模型选择。minimal.py可以只把 DSH_MODEL 读作命令的默认 model 参数;显式 --model 不需要匹配的子进程环境值。端点与凭据变量继续由 DeepSeek 适配器现有的环境解析路径持有。
验证
Web 回放会启动完整 Web 宿主,通过 preset 服务创建 agent,并断言不存在作用域文件系统或压缩服务、没有追加 system-prompt 拥有的 runtime-context 消息,而且组装请求只包含固定提示词与持久 Bash。随后,它通过真实作用域服务执行持久 Bash。
SDK keyless 源码测试启动真实 dsh --profile sdk-minimal,使用环境选择的提示词完成一个回合,并断言生成的单组合包 manifest。Python SDK 打包运行时快照固定组装提示词、精确单工具目录,并固定不存在任何 system-prompt 所拥有的 runtime-context 消息。打包运行时覆盖会通过每种可用载体,使用环境选择的模型、模型容量和提示词值初始化独立 profile,然后执行所选持久 shell。Cordis 校验会检查两份配置能否解析声明的插件和配置字段。
考虑过的替代方案
以较高阈值保留 compaction-basic。 不予采用,因为即便提供方在短测试中未触发,较长会话仍允许替换历史记录,而且 minimal 组合仍会依赖模型容量元数据与 token meter。
移除编辑器后保留 fs-local。 不予采用,因为两份 minimal 组合都没有其他文件系统消费方。保留该提供方只会扩大运行时清单,不会新增模型可见能力。
为 Web 与 Python SDK 启动使用同一个 Cordis leaf。 不予采用,因为 Web preset 向现有多会话宿主贡献 agent 作用域服务,而 Python SDK 必须启动包含 JSON-RPC 服务器及其进程级依赖的完整进程。
把请求模型镜像到 DSH_MODEL。 不予采用,因为直接适配器接受不在建议目录中的模型 id,并为它们解析后备上下文元数据。镜像会为同一项选择制造两个输入;SDK 初始化请求具有权威,DSH_MODEL 只保留为 minimal.py 的便捷默认值。
后果
Minimal 会话不会摘要或替换较早历史,也不会添加 runtime-context 快照;调用方必须让会话轮次保持在所选模型的上下文容量内,且不得依赖模型可见的常驻沙箱或批准策略说明。两条启动路径共享单工具、无文件系统、无上下文与无压缩保证,同时保留适合各自所有者的不同提示词和模型配置。Python SDK 路径只通过内置 dsh stdio JSON-RPC profile 通信。