Skip to content

Commit d6faa22

Browse files
docs(adapters): say that custom-adapter placeholders are substituted quoted
Lane B #6: neither the setup guide's custom-agents section nor the agent-adapters spec said that {binary} (lane B) and now {persona}, {session_dir} and env values (the previous commit) are shlex-quoted on substitution, so a reader following the YAML example had no way to know that wrapping a placeholder in quotes is unnecessary -- and that a template which does so is substituted raw there rather than quoted twice. One sentence in each. `openspec validate --specs --all`: 26 passed, warning count unchanged (84 before and after; the long-requirement warnings pre-date this). Lane J (harness-small), B#6.
1 parent ff25b1a commit d6faa22

2 files changed

Lines changed: 10 additions & 1 deletion

File tree

‎docs/setup-guide.md‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -365,6 +365,11 @@ agents:
365365
format: generic
366366
```
367367

368+
`{binary}`, `{persona}` and `{session_dir}` are substituted shell-quoted (a
369+
path with a space arrives as one argument), as are `env` values, so do not wrap
370+
the placeholders in quotes yourself; a template that already quotes one
371+
(`"{persona}"`) is substituted raw there and still works.
372+
368373
### Web PWA (recommended)
369374

370375
The study web app requires no extra dependencies — just run:

‎openspec/specs/agent-adapters/spec.md‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,11 @@ instances via `build_custom_adapter()`. Each entry specifies `binary`,
5454
`{binary}`, `{persona}`, `{session_dir}` placeholders), optional
5555
`resume` template, optional `env` vars, optional `teardown` shell
5656
command, and optional `mcp` config. Custom adapters are merged after
57-
built-ins, winning on name collision.
57+
built-ins, winning on name collision. The launch string is shell text:
58+
each placeholder value and each `env` value is substituted
59+
`shlex.quote`d, except a placeholder the template itself already wraps
60+
in quotes (`"{persona}"`), which is substituted raw so it is not quoted
61+
twice.
5862

5963
#### Scenario: User defines a custom "aider" adapter in config.yaml
6064
- **WHEN** `agents.custom.aider` is configured with

0 commit comments

Comments
 (0)