Skip to content

fix(admin): detail custom LLM validation errors - #5137

Merged
chrarnoldus merged 1 commit into
mainfrom
fix/custom-llm-validation-errors
Aug 7, 2026
Merged

chrarnoldus merged 1 commit into
mainfrom
fix/custom-llm-validation-errors

Conversation

@chrarnoldus

Copy link
Copy Markdown
Contributor

Summary

  • Introduce formatZodError / formatZodIssues to unwrap and format Zod validation issues, including invalid_union branches and unrecognized_keys.
  • Fix the Custom LLM editor so validation failures on union schemas (such as API key vs Google service account auth) surface actionable field-level error messages instead of : Invalid input.
  • Validate public_id prefix client-side before submission for immediate feedback.

@chrarnoldus chrarnoldus self-assigned this Aug 7, 2026
@kilo-code-bot

kilo-code-bot Bot commented Aug 7, 2026 •

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Executive Summary

Reviewed the custom-LLM validation-error formatting fix end to end — new formatZodError/formatZodIssues helpers with union branch selection, 207 lines of tests, and the admin editor integration — and found no correctness, security, or memory-leak issues in the changed code; the union branch-selection logic, tRPC data.zodError/JSON-message fallbacks, and trimmed public_id handling were all verified against the actual CustomLlmDefinitionSchema, the tRPC error formatter, and zod 4.4.3 issue types.

Files Reviewed (3 files)
  • apps/web/src/app/admin/custom-llms/CustomLlmsContent.tsx
  • apps/web/src/lib/zod/format-zod-error.ts
  • apps/web/src/lib/zod/format-zod-error.test.ts

Reviewed by kimi-k3 · Input: 84.6K · Output: 17.2K · Cached: 590.7K

Review guidance: REVIEW.md from base branch main

@chrarnoldus
chrarnoldus merged commit 4757593 into main Aug 7, 2026
13 of 15 checks passed
@chrarnoldus
chrarnoldus deleted the fix/custom-llm-validation-errors branch August 7, 2026 14:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants