feat: add agentId field to HookAgentPayload and implement normalization

This commit is contained in:
Suraj Anand 2026-01-28 22:00:07 +05:30 committed by GitHub
parent e967527498
commit 8ae29f8568
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

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