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:
1 parent
c49acfdb2c
commit
4bc4296494
6 files changed
+131
-12
No files matched your search
@@ -74,6 +74,7 @@ test('facetContextText carries the binding that does change', () => {
|
||||
assert.equal(
|
||||
ask,
|
||||
'facet: /w/src/room\n' +
|
||||
'session folder: /w — relative paths in tool calls resolve here\n' +
|
||||
'outside the facet: put to the user as a question — say in one line what you need and why, then record it with `facet action=add` so the rest of the session does not have to ask again',
|
||||
)
|
||||
|
||||
@@ -81,6 +82,7 @@ test('facetContextText carries the binding that does change', () => {
|
||||
assert.equal(
|
||||
deny,
|
||||
'facet: /w/src/room\n' +
|
||||
'session folder: /w — relative paths in tool calls resolve here\n' +
|
||||
'granted outside it: src/shared\n' +
|
||||
'outside the facet: refused — ask the user to widen the facet from its context panel, or with `facet action=add` where that can be granted',
|
||||
)
|
||||
|
||||
Reference in new issue
Block a user