Fix agent model fallback and title/branch tool parsing

This commit is contained in:
Mohamed Boudra
2026-01-23 10:14:46 +07:00
parent 53155ebcc9
commit f8ba0ff239
3 changed files with 11 additions and 2 deletions
@@ -22,6 +22,9 @@ const PrincipalParamSchema = z.union([
// Command as array (Codex sends this)
z.object({ command: z.array(z.string()).nonempty() }).transform((d) => ({ type: "command" as const, value: d.command.join(" ") })),
// Other text params
z.object({ title: z.string() }).transform((d) => ({ type: "text" as const, value: d.title })),
z.object({ name: z.string() }).transform((d) => ({ type: "text" as const, value: d.name })),
z.object({ branch: z.string() }).transform((d) => ({ type: "text" as const, value: d.branch })),
z.object({ pattern: z.string() }).transform((d) => ({ type: "text" as const, value: d.pattern })),
z.object({ query: z.string() }).transform((d) => ({ type: "text" as const, value: d.query })),
z.object({ url: z.string() }).transform((d) => ({ type: "text" as const, value: d.url })),