🤝 fix: Normalize Empty Handoff Fields to Restore Default Fallback (#12707)

* fix(agents): normalize handoff prompt and parameter values to ensure default instructions

* fix(agents): address lint errors and codex review comments
This commit is contained in:
Luna 2026-04-20 00:53:09 +09:00 • committed by GitHub
parent b579390287
commit 8f39f31c87
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 14 additions and 6 deletions

View file

@ -44,11 +44,11 @@ export const agentSupportContactSchema = z
export const graphEdgeSchema = z.object({
from: z.union([z.string(), z.array(z.string())]),
to: z.union([z.string(), z.array(z.string())]),
description: z.string().optional(),
description: z.string().optional().transform((v) => (v === '' ? undefined : v)),
edgeType: z.enum(['handoff', 'direct']).optional(),
prompt: z.union([z.string(), z.function()]).optional(),
prompt: z.union([z.string(), z.function()]).optional().transform((v) => (v === '' ? undefined : v)),
excludeResults: z.boolean().optional(),
promptKey: z.string().optional(),
promptKey: z.string().optional().transform((v) => (v === '' ? undefined : v)),
});
/** Per-tool options schema (defer_loading, allowed_callers) */