DSH / Atlas
2026-11-23implementedfeature

Apply patch follows edit

Apply patch 跟随 edit

[Shipped filesystem mutation defaults](2026-10-29-shipped-fs-mutation-defaults.md) enabled `apply_patch` by stating `applyPatch: true` on the `dsh-base` `tool-fs` row and the Web `standard` preset, while the `ptc` and `cordis` presets and the PTC overlay stated `false` and the `tool-fs` schema defaulted to `false`. Agent presets list complete plugin declarations with no shared parent, so every shipped default had to

Source compatibility: Chinese status uses a compatible non-canonical header

English

Problem

Shipped filesystem mutation defaults enabled apply_patch by stating applyPatch: true on the dsh-base tool-fs row and the Web standard preset, while the ptc and cordis presets and the PTC overlay stated false and the tool-fs schema defaulted to false. Agent presets list complete plugin declarations with no shared parent, so every shipped default had to be repeated on each row, and the shipped coding presets offered different file-editing tools for the same workspace.

Decision

  • tool-fs resolves an unset applyPatch to the resolved edit value in an explicit resolveConfig step (src/index.ts); an explicit true or false wins, and the schema carries no applyPatch default.
  • The dsh-base tool-fs row (headless, SDK, and ACP), the Web and Desktop standard, ptc, and cordis presets, and the shipped PTC overlay state no applyPatch, so each offers apply_patch beside edit: a JSON tool under native execution and a run_code binding under PTC. The Web minimal preset and sdk-minimal set edit: false and omit it. The SDK and Desktop standard and ptc tool sets stay equal.
  • The fixed-budget compaction scenarios keep pinning applyPatch: false, because their thresholds were tuned to the recorded tool set.

Alternatives considered

State applyPatch: true on each shipped row. Every preset and the base row would repeat the value, and a new composition that enables edit would have to remember it; deriving the default inside tool-fs decides it in one place.

Keep apply_patch off in the PTC and cordis presets. The PTC compositions were evaluated without the tool, but keeping it off leaves the shipped coding presets with different file-editing tools for the same workspace. Under PTC the tool is a run_code binding rather than a JSON schema, so it adds little to each request. Unlike the base and standard defaults, enabling it in these presets rests on that consistency, not on a separate benchmark run.

Consequences

Every tool-fs row that keeps edit and states no applyPatch registers apply_patch, including rows in third-party profiles, presets, and plugins; the upgrade guide names the one-key opt-out. dsh --dump-config renders only stated keys, so the derived value is visible in model requests, not in the dump. Recorded expectations whose tool-fs rows enable edit without applyPatch carry the tool's guidance and schema.

Testing

tool-fs registration tests cover the derived default and both explicit overrides. web-agent-presets.e2e.ts asserts apply_patch in the cordis tool set and in the ptc run_code bindings; the keyless SDK smoke checks the native tool and the PTC overlay binding; desktop-tools.expected.e2e.ts compares the SDK profile's first model request, tool schemas included, with the Desktop standard preset's.

中文

问题

随发行版交付的文件系统修改默认值通过在 dsh-base 的 tool-fs 行与 Web 的 standard preset 上写出 applyPatch: true 来开启 apply_patch,而 ptc、cordis preset 与 PTC overlay 写出 false,tool-fs schema 的默认值也是 false。Agent preset 列出完整的插件声明,没有共同的父级,因此每个内置默认值都要在每一行上重复,随发行版交付的各编码 preset 也会对同一工作区提供不同的文件编辑工具。

决策

  • tool-fs 在显式的 resolveConfig 步骤(src/index.ts)中把未设置的 applyPatch 解析为解析后的 edit 值;显式写出的 true 或 false 优先,schema 不再为 applyPatch 提供默认值。
  • dsh-base 的 tool-fs 行(headless、SDK、ACP)、Web 与 Desktop 的 standard、ptc、cordis preset,以及随发行版交付的 PTC overlay 都不写 applyPatch,因此都在 edit 旁提供 apply_patch:原生执行下是 JSON 工具,PTC 下是 run_code 绑定。Web 的 minimal preset 与 sdk-minimal 设置 edit: false,不提供它。SDK 与 Desktop 的 standard、ptc 工具集保持一致。
  • 固定 token 预算的压缩场景继续钉住 applyPatch: false,因为它们的阈值是按录制时的工具集调的。

考虑过的替代方案

在每个内置行上写出 applyPatch: true。 每个 preset 和 base 行都要重复这个值,新的组合开启 edit 时也必须记得写上;在 tool-fs 内推导默认值,只需在一处决定。

在 PTC 与 cordis preset 中保持 apply_patch 关闭。 PTC 组合是在没有该工具的情况下评测的,但保持关闭会让随发行版交付的各编码 preset 对同一工作区提供不同的文件编辑工具。PTC 下该工具是 run_code 内的绑定而非 JSON schema,每个请求增加的内容很少。与 base 和 standard 的默认值不同,这两个 preset 开启它依据的是这种一致性,而不是单独的 benchmark。

后果

每个保留 edit 且未写 applyPatch 的 tool-fs 行都会注册 apply_patch,包括第三方 profile、preset 和插件中的行;升级指南给出关闭它所需的一个键。dsh --dump-config 只渲染显式写出的键,因此推导出的值只能在模型请求中看到,在输出中看不到。tool-fs 行开启 edit 而未写 applyPatch 的录制预期带有该工具的提示语与 schema。

测试

tool-fs 注册测试覆盖推导出的默认值和两种显式覆盖。web-agent-presets.e2e.ts 断言 cordis 工具集与 ptc 的 run_code 绑定中都有 apply_patch;keyless SDK smoke 检查原生工具和 PTC overlay 下的绑定;desktop-tools.expected.e2e.ts 比较 SDK profile 与 Desktop standard preset 的首个模型请求(含工具 schema)。