fix: propagate agent run context for subagent announce

This commit is contained in:
Peter Steinberger
2026-01-19 00:45:03 +00:00
parent 953472bf25
commit 989543c9c3
8 changed files with 157 additions and 3 deletions

View File

@@ -49,6 +49,8 @@ const BASE_IMAGE_PNG =
function expectChannels(call: Record<string, unknown>, channel: string) {
expect(call.channel).toBe(channel);
expect(call.messageChannel).toBe(channel);
const runContext = call.runContext as { messageChannel?: string } | undefined;
expect(runContext?.messageChannel).toBe(channel);
}
const createRegistry = (channels: PluginRegistry["channels"]): PluginRegistry => ({
@@ -325,6 +327,8 @@ describe("gateway server agent", () => {
expectChannels(call, "whatsapp");
expect(call.to).toBe("+1555");
expect(call.accountId).toBe("kev");
const runContext = call.runContext as { accountId?: string } | undefined;
expect(runContext?.accountId).toBe("kev");
ws.close();
await server.close();