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, }, }; }