forked from cardosofelipe/fast-next-template
Root cause: The demo data's model_params was missing `top_p`, but the Zod schema required all three fields (temperature, max_tokens, top_p). This caused silent validation failures when editing agent types. Fixes: 1. Add getInitialValues() that ensures all required fields have defaults 2. Handle nested validation errors in handleFormError (e.g., model_params.top_p) 3. Add useEffect to reset form when agentType changes 4. Add console.error logging for debugging validation failures 5. Update demo data to include top_p in all agent types The form now properly initializes with safe defaults for any missing fields from the API response, preventing silent validation failures. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>