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

@@ -1962,7 +1962,28 @@ describe("web auto-reply", () => {
it("uses identity.name for messagePrefix when set", async () => {
setLoadConfigMock(() => ({
identity: { name: "Richbot", emoji: "🦁" },
agents: {
list: [
{
id: "main",
default: true,
identity: { name: "Mainbot", emoji: "🦞", theme: "space lobster" },
},
{
id: "rich",
identity: { name: "Richbot", emoji: "🦁", theme: "lion bot" },
},
],
},
bindings: [
{
agentId: "rich",
match: {
provider: "whatsapp",
peer: { kind: "dm", id: "+1555" },
},
},
],
}));
let capturedOnMessage:
@@ -2003,8 +2024,28 @@ describe("web auto-reply", () => {
it("uses identity.name for responsePrefix when set", async () => {
setLoadConfigMock(() => ({
identity: { name: "Richbot", emoji: "🦁" },
whatsapp: { allowFrom: ["*"] },
agents: {
list: [
{
id: "main",
default: true,
identity: { name: "Mainbot", emoji: "🦞", theme: "space lobster" },
},
{
id: "rich",
identity: { name: "Richbot", emoji: "🦁", theme: "lion bot" },
},
],
},
bindings: [
{
agentId: "rich",
match: {
provider: "whatsapp",
peer: { kind: "dm", id: "+1555" },
},
},
],
}));
let capturedOnMessage: