fix: derive prefixes from routed identity (#578) (thanks @p6l-richard)

This commit is contained in:
Peter Steinberger
2026-01-09 16:39:32 +01:00
parent 43848b7b43
commit 66bbb723c5
18 changed files with 156 additions and 27 deletions

View File

@@ -17,7 +17,10 @@ import { GatewayIntents, GatewayPlugin } from "@buape/carbon/gateway";
import type { APIAttachment } from "discord-api-types/v10";
import { ApplicationCommandOptionType, Routes } from "discord-api-types/v10";
import { resolveAckReaction } from "../agents/identity.js";
import {
resolveAckReaction,
resolveResponsePrefix,
} from "../agents/identity.js";
import { resolveTextChunkLimit } from "../auto-reply/chunk.js";
import { hasControlCommand } from "../auto-reply/command-detection.js";
import {
@@ -1030,7 +1033,7 @@ export function createDiscordMessageHandler(params: {
let didSendReply = false;
const { dispatcher, replyOptions, markDispatchIdle } =
createReplyDispatcherWithTyping({
responsePrefix: cfg.messages?.responsePrefix,
responsePrefix: resolveResponsePrefix(cfg, route.agentId),
deliver: async (payload) => {
await deliverDiscordReply({
replies: [payload],
@@ -1510,7 +1513,7 @@ function createDiscordNativeCommand(params: {
let didReply = false;
const dispatcher = createReplyDispatcher({
responsePrefix: cfg.messages?.responsePrefix,
responsePrefix: resolveResponsePrefix(cfg, route.agentId),
deliver: async (payload, _info) => {
await deliverDiscordInteractionReply({
interaction,