fix: stop the facet preset naming a prompt variable the harness dropped

The preset's persona row copied the deployment's suffix, "Your working directory
is {{cwd}}". The harness substitutes only registered prompt variables and throws
on an unregistered one during prompt assembly — so when a harness release stopped
registering `cwd` (only `provider` and `model` remain), every session on this
preset failed its first turn with

  unknown prompt variable "{{cwd}}" in section "deployment:persona-suffix"

and chat was dead rather than degraded. The row now carries the prefix only.

The folder is stated where it can follow the session instead: the facet binding
already names the facet, and now names the session folder as well when the two
differ — which is every conversation that started higher up and was narrowed, and
exactly the case where relative tool paths need saying out loud.

`test/presets.test.js` makes this class of failure impossible to reintroduce
silently: it scans every shipped preset for a variable reference and requires the
name to be one the harness registers, and holds this bundle's own rule and
binding text to no references at all. Restoring the old suffix fails it.
This commit is contained in:
NotExpectedYet committed 2026-10-19 09:56:26 +01:00
1 parent c49acfdb2c
commit 4bc4296494
6 files changed
+131 -12

No files matched your search

+17 -5
View File
@@ -1,21 +1,27 @@
# Agent preset facet: one `@deepseek-ai/dsh-agent-preset` declaration inserted
# after the web patch.
#
# The composition is `standard` with two changes, and this file is the only place
# either of them is decided:
# The composition is `standard` with three changes, and this file is the only
# place any of them is decided:
#
# * compaction is configured (see the `compaction` row below) so the pressure
# trigger is a budget rather than a formality. The shipped ratio is 0.80 of a
# 1,000,000-token window, i.e. 800k, and on this deployment nothing has ever
# come within 1.5% of it — compaction had never once run;
#
# * `facet-guard` is mounted, which confines the session to its own folder.
# * `facet-guard` is mounted, which confines the session to its own folder;
#
# * the persona row carries no suffix. The shipped one states the working
# directory through a prompt variable the harness no longer registers, and
# an unregistered variable fails the whole turn — see the note on that row.
#
# Everything else is copied verbatim from the shipped `standard` patch, and that
# is deliberate: a preset declaration replaces the whole plugin list rather than
# merging into it, so a clone that drifts from the original silently loses
# whatever it drifted past. When the harness next changes `standard`, re-copy
# this file and re-apply the two changes — do not hand-patch around it.
# this file and re-apply the three changes — do not hand-patch around it. The
# persona row must be re-checked by hand: re-copying it from `standard` restores
# the suffix, and the harness's variable set is what decides whether it composes.
- insert:
- id: preset-facet
name: '@deepseek-ai/dsh-agent-preset'
@@ -25,10 +31,16 @@
description: One module of the system, not all of it — the session's own folder, plus the files you grant.
order: 5
plugins:
# No suffix. It used to state the working directory through the `cwd`
# prompt variable, which the harness does not register — and an unknown
# variable is not rendered as text: assembly throws and the whole turn
# fails with it. Only `provider` and `model` are registered now, so the
# prefix keeps its model reference and the folder is stated per session
# by `facet-guard`'s runtime binding instead, which follows the user
# when they narrow it.
- id: persona
name: '@deepseek-ai/dsh-persona'
config:
suffix: Your working directory is {{cwd}}.
prefix: You are a coding agent powered by the {{model}} model.
- id: agent-instructions
name: '@deepseek-ai/dsh-agent-instructions'