openclaw/src/slack
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
..
monitor feat: add dynamic template variables to messages.responsePrefix (#923) 2026-01-14 23:05:08 -05:00
.DS_Store refactor(src): split oversized modules 2026-01-14 01:17:56 +00:00
accounts.ts chore: migrate to oxlint and oxfmt 2026-01-14 15:02:19 +00:00
actions.ts chore: migrate to oxlint and oxfmt 2026-01-14 15:02:19 +00:00
channel-migration.test.ts feat(config): gate channel config writes 2026-01-15 01:41:15 +00:00
channel-migration.ts feat(config): gate channel config writes 2026-01-15 01:41:15 +00:00
format.test.ts refactor: unify markdown formatting pipeline 2026-01-15 00:31:07 +00:00
format.ts fix: preserve markdown code fences 2026-01-15 00:31:07 +00:00
index.ts feat: add slack multi-account routing 2026-01-08 08:49:16 +01:00
monitor.test.ts Slack: accept slash command names with or without leading slash 2026-01-12 21:27:04 -06:00
monitor.tool-result.forces-thread-replies-replytoid-is-set.test.ts chore: migrate to oxlint and oxfmt 2026-01-14 15:02:19 +00:00
monitor.tool-result.sends-tool-summaries-responseprefix.test.ts fix(slack): respect top-level requireMention config 2026-01-15 02:17:27 +00:00
monitor.tool-result.threads-top-level-replies-replytomode-is-all.test.ts chore: migrate to oxlint and oxfmt 2026-01-14 15:02:19 +00:00
monitor.ts refactor(src): split oversized modules 2026-01-14 01:17:56 +00:00
probe.ts chore: migrate to oxlint and oxfmt 2026-01-14 15:02:19 +00:00
send.ts refactor: unify markdown formatting pipeline 2026-01-15 00:31:07 +00:00
threading.test.ts refactor: centralize slack threading helpers 2026-01-09 16:01:53 +00:00
threading.ts chore: migrate to oxlint and oxfmt 2026-01-14 15:02:19 +00:00
token.ts Slack: add some fixes and connect it all up 2026-01-04 01:53:26 -06:00
types.ts refactor: centralize slack threading helpers 2026-01-09 16:01:53 +00:00