openclaw/docs/gateway
Sebastian d0a4cce41e feat: add dynamic template variables to messages.responsePrefix (#923)
Adds support for template variables in `messages.responsePrefix` that
resolve dynamically at runtime with the actual model used (including
after fallback).

Supported variables (case-insensitive):
- {model} - short model name (e.g., "claude-opus-4-5", "gpt-4o")
- {modelFull} - full model identifier (e.g., "anthropic/claude-opus-4-5")
- {provider} - provider name (e.g., "anthropic", "openai")
- {thinkingLevel} or {think} - thinking level ("high", "low", "off")
- {identity.name} or {identityName} - agent identity name

Example: "[{model} | think:{thinkingLevel}]" → "[claude-opus-4-5 | think:high]"

Variables show the actual model used after fallback, not the intended
model. Unresolved variables remain as literal text.

Implementation:
- New module: src/auto-reply/reply/response-prefix-template.ts
- Template interpolation in normalize-reply.ts via context provider
- onModelSelected callback in agent-runner-execution.ts
- Updated all 6 provider message handlers (web, signal, discord,
  telegram, slack, imessage)
- 27 unit tests covering all variables and edge cases
- Documentation in docs/gateway/configuration.md and JSDoc

Fixes #923
2026-01-14 23:05:08 -05:00
..
authentication.md docs: clarify Claude CLI auth mode 2026-01-15 02:35:20 +00:00
background-process.md fix: rename bash tool to exec (#748) (thanks @myfunc) 2026-01-12 02:49:55 +00:00
bonjour.md Docs: fix internal links 2026-01-10 14:51:33 -06:00
bridge-protocol.md docs: add protocol docs 2026-01-12 04:44:27 +00:00
cli-backends.md chore: standardize Claude Code CLI naming (#915) 2026-01-14 20:07:35 +00:00
configuration-examples.md docs: complete channels rename sweep 2026-01-13 08:40:39 +00:00
configuration.md feat: add dynamic template variables to messages.responsePrefix (#923) 2026-01-14 23:05:08 -05:00
discovery.md refactor!: rename chat providers to channels 2026-01-13 08:40:39 +00:00
doctor.md fix: finalize channels rename cleanup 2026-01-13 08:40:40 +00:00
gateway-lock.md docs: reorganize documentation structure 2026-01-07 00:45:46 +01:00
health.md docs: complete channels rename sweep 2026-01-13 08:40:39 +00:00
heartbeat.md docs: complete channels rename sweep 2026-01-13 08:40:39 +00:00
index.md docs: complete channels rename sweep 2026-01-13 08:40:39 +00:00
local-models.md docs: simplify local models guidance 2026-01-13 03:26:00 +00:00
logging.md fix: finalize channels rename cleanup 2026-01-13 08:40:40 +00:00
openai-http-api.md Gateway: disable OpenAI HTTP chat completions by default (#686) 2026-01-10 21:55:54 +00:00
pairing.md docs: refresh and simplify docs 2026-01-08 23:07:20 +01:00
protocol.md refactor!: rename chat providers to channels 2026-01-13 08:40:39 +00:00
remote-gateway-readme.md docs: make remote host examples generic 2026-01-12 02:11:33 +00:00
remote.md refactor!: rename chat providers to channels 2026-01-13 08:40:39 +00:00
sandbox-vs-tool-policy-vs-elevated.md feat(tools): add tool profiles and group shorthands 2026-01-13 06:30:20 +00:00
sandboxing.md docs: clarify sandbox bind mounts (#790) 2026-01-12 22:06:35 +00:00
security.md Security: add detect-secrets scan 2026-01-15 03:14:43 +00:00
tailscale.md docs: update faq and install guidance 2026-01-13 08:03:11 +00:00
troubleshooting.md Security: add detect-secrets scan 2026-01-15 03:14:43 +00:00