DSH / Atlas
2026-09-14implementedarchitecture

Default DeepSeek Session-log upload

DeepSeek 会话日志默认上传

Ordinary DeepSeek requests do not contain the complete canonical Session trajectory. Requiring each installation to enable log contribution prevents the default product configuration from supplying that trajectory. Recorded-session scenarios also need stable, explicit upload policies because acceptance events are part of their expected logs.

English

Problem

Ordinary DeepSeek requests do not contain the complete canonical Session trajectory. Requiring each installation to enable log contribution prevents the default product configuration from supplying that trajectory. Recorded-session scenarios also need stable, explicit upload policies because acceptance events are part of their expected logs.

Decision

session-log-deepseek.Config.enabled defaults to true in every process. A resolved enabled: false disables the contribution; configuration precedence determines which value takes effect. The plugin does not inspect test-runner or snapshot environment variables.

The enabled value is read for each request through a volatile reference so a saved preference takes effect without restarting the plugin. Profile writes can override bundle defaults under the profile-owned configuration rules; home patches and command-line overlays still reject conflicting writes. Disabling upload leaves the acceptance watermark unchanged because it records provider acceptance, not user eligibility. Re-enabling therefore sends the unaccepted suffix, including events recorded while disabled. Already prepared requests retain their payload.

This supersedes only the opt-in default in the request-extension decision; that note still owns field serialization, destinations, acceptance, and retry semantics. The headless and ACP corpus base patches and Web scaffold explicitly disable upload. Later scenario patches can enable it. The SDK text-turn recording omits the setting and exercises the shipped default, including durable acceptance events.

Alternatives considered

Derive the production default from test environment markers. This also changes downstream SDK behavior when callers inherit those variables and makes ordinary tests exercise a different product default.

Refresh every recorded Session to include upload acceptance. Explicit test composition preserves the existing scenarios while a default-configured SDK recording and Loader regression cover the default-on path.

Retain opt-in upload. This does not supply the complete trajectory from ordinary product requests without installation-specific configuration.

Consequences

Eligible requests send the unaccepted canonical log suffix, up to maxBytes per request under the bounded-upload decision, including message text, tool arguments and results, workspace paths, and feedback, to the resolved DeepSeek endpoint or configured gateway. No prompt tokens or model-visible content are added. Request bodies grow by up to that limit, and provider rejection still fails the request. OTel remains independent; disabling OTel does not disable this contribution.

Configuration tests cover default-on and explicit overrides with and without test environment markers. Both DeepSeek protocol Loader cases observe the default request field and recorded acceptance watermark, and explicit-off cases observe their absence. Existing headless, ACP, Web, and SDK recordings validate their declared upload policies without rewriting committed Session generations.

中文

问题

普通 DeepSeek 请求不包含完整的规范会话轨迹。要求每个安装环境启用日志贡献,会使默认产品配置无法提供该轨迹。录制会话场景也需要稳定、明确的上传策略,因为接受事件属于其期望日志。

决策

session-log-deepseek.Config.enabled 在所有进程中均默认为 true。最终生效的 enabled: false 会关闭贡献;配置优先级决定采用哪个值。插件不读取测试运行器或快照环境变量。

每次请求通过 volatile 引用读取 enabled,因此保存的偏好无需重启插件即可生效。按照 profile 所有的配置规则,profile 写入可覆盖组合包默认值;home patch 和命令行 overlay 仍会拒绝冲突写入。关闭上传不改变接受水位,因为它记录提供方的接受结果,而不是用户是否允许上传。重新开启后会发送尚未接受的后缀,包括关闭期间记录的事件。已准备的请求保留原有载荷。

本决策仅取代请求扩展决策中的主动启用默认策略;该记录仍负责字段序列化、目的地址、接受与重试语义。headless 和 ACP 语料的基础 patch 以及 Web scaffold 显式关闭上传。后续场景 patch 可以启用上传。SDK text-turn 录制省略该设置,验证产品默认值及持久接受事件。

考虑过的替代方案

根据测试环境标记决定生产默认值。 调用者继承这些变量时,下游 SDK 行为也会改变,普通测试还会采用不同的产品默认值。

刷新所有录制会话以包含上传接受事件。 显式测试配置保留现有场景,同时使用默认配置的 SDK 录制和 Loader 回归验证默认开启路径。

保留主动启用策略。 没有安装环境专用配置时,该策略无法从普通产品请求提供完整轨迹。

后果

符合条件的请求会向解析后的 DeepSeek 端点或已配置网关发送未接受的规范日志后缀,按有上限上传决策每次最多 maxBytes,包括消息文本、工具参数与结果、工作区路径和反馈。不增加提示词 token 或模型可见内容。请求正文最多增加该上限,提供方拒绝仍会使请求失败。OTel 保持独立,关闭 OTel 不会关闭此贡献。

配置测试覆盖有无测试环境标记时的默认开启与显式覆盖。两种 DeepSeek 协议的 Loader 用例观察默认请求字段和已记录的接受水位,显式关闭用例观察两者均不存在。现有 headless、ACP、Web 和 SDK 录制验证各自声明的上传策略,无需重写已提交的会话代际。