From 8ae29f8568bbf8dc91f63a60a7665ac47eb2b2a9 Mon Sep 17 00:00:00 2001 From: Suraj Anand Date: Wed, 28 Jan 2026 22:00:07 +0530 Subject: [PATCH] feat: add agentId field to HookAgentPayload and implement normalization --- src/gateway/hooks.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/gateway/hooks.ts b/src/gateway/hooks.ts index 1fc6d52f4..00027ec33 100644 --- a/src/gateway/hooks.ts +++ b/src/gateway/hooks.ts @@ -137,6 +137,7 @@ export type HookAgentPayload = { model?: string; thinking?: string; timeoutSeconds?: number; + agentId?: string; }; const listHookChannelValues = () => ["last", ...listChannelPlugins().map((plugin) => plugin.id)]; @@ -195,7 +196,9 @@ export function normalizeAgentPayload( const timeoutSeconds = typeof timeoutRaw === "number" && Number.isFinite(timeoutRaw) && timeoutRaw > 0 ? Math.floor(timeoutRaw) - : undefined; + : un + const agentIdRaw = payload.agentId; + const agentId = typeof agentIdRaw === "string" && agentIdRaw.trim() ? agentIdRaw.trim() : undefined;defined; return { ok: true, value: { @@ -209,6 +212,7 @@ export function normalizeAgentPayload( model, thinking, timeoutSeconds, + agentId, }, }; }