refactor(messages): centralize per-agent prefixes

This commit is contained in:
Peter Steinberger
2026-01-09 16:52:25 +01:00
parent 8341b662af
commit 36bdec0f2c
14 changed files with 144 additions and 48 deletions

View File

@@ -8,7 +8,7 @@ import { Bot, InputFile, webhookCallback } from "grammy";
import { resolveDefaultAgentId } from "../agents/agent-scope.js";
import {
resolveAckReaction,
resolveResponsePrefix,
resolveEffectiveMessagesConfig,
} from "../agents/identity.js";
import { EmbeddedBlockChunker } from "../agents/pi-embedded-block-chunker.js";
import {
@@ -729,7 +729,8 @@ export function createTelegramBot(opts: TelegramBotOptions) {
const { dispatcher, replyOptions, markDispatchIdle } =
createReplyDispatcherWithTyping({
responsePrefix: resolveResponsePrefix(cfg, route.agentId),
responsePrefix: resolveEffectiveMessagesConfig(cfg, route.agentId)
.responsePrefix,
deliver: async (payload, info) => {
if (info.kind === "final") {
await flushDraft();