feat: wire multi-agent config and routing
Co-authored-by: Mark Pors <1078320+pors@users.noreply.github.com>
This commit is contained in:
@@ -114,7 +114,9 @@ describe("deliverOutboundPayloads", () => {
|
||||
|
||||
it("uses iMessage media maxBytes from agent fallback", async () => {
|
||||
const sendIMessage = vi.fn().mockResolvedValue({ messageId: "i1" });
|
||||
const cfg: ClawdbotConfig = { agent: { mediaMaxMb: 3 } };
|
||||
const cfg: ClawdbotConfig = {
|
||||
agents: { defaults: { mediaMaxMb: 3 } },
|
||||
};
|
||||
|
||||
await deliverOutboundPayloads({
|
||||
cfg,
|
||||
|
||||
@@ -82,7 +82,9 @@ function resolveMediaMaxBytes(
|
||||
: (cfg.imessage?.accounts?.[normalizedAccountId]?.mediaMaxMb ??
|
||||
cfg.imessage?.mediaMaxMb);
|
||||
if (providerLimit) return providerLimit * MB;
|
||||
if (cfg.agent?.mediaMaxMb) return cfg.agent.mediaMaxMb * MB;
|
||||
if (cfg.agents?.defaults?.mediaMaxMb) {
|
||||
return cfg.agents.defaults.mediaMaxMb * MB;
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
|
||||
|
||||
@@ -130,7 +130,7 @@ export function resolveHeartbeatDeliveryTarget(params: {
|
||||
entry?: SessionEntry;
|
||||
}): OutboundTarget {
|
||||
const { cfg, entry } = params;
|
||||
const rawTarget = cfg.agent?.heartbeat?.target;
|
||||
const rawTarget = cfg.agents?.defaults?.heartbeat?.target;
|
||||
const target: HeartbeatTarget =
|
||||
rawTarget === "whatsapp" ||
|
||||
rawTarget === "telegram" ||
|
||||
@@ -148,9 +148,9 @@ export function resolveHeartbeatDeliveryTarget(params: {
|
||||
}
|
||||
|
||||
const explicitTo =
|
||||
typeof cfg.agent?.heartbeat?.to === "string" &&
|
||||
cfg.agent.heartbeat.to.trim()
|
||||
? cfg.agent.heartbeat.to.trim()
|
||||
typeof cfg.agents?.defaults?.heartbeat?.to === "string" &&
|
||||
cfg.agents.defaults.heartbeat.to.trim()
|
||||
? cfg.agents.defaults.heartbeat.to.trim()
|
||||
: undefined;
|
||||
|
||||
const lastProvider =
|
||||
|
||||
Reference in New Issue
Block a user