LocalAI/core/config
lif 8bd7143a44
fix: propagate validation errors (#7787)
fix: validate MCP configuration in model config

Fixes #7334

The Validate() function was not checking if MCP configuration
(mcp.stdio and mcp.remote) contains valid JSON. This caused
malformed JSON with missing commas to be silently accepted.

Changes:
- Add MCP configuration validation to ModelConfig.Validate()
- Properly report validation errors instead of discarding them
- Add test cases for valid and invalid MCP configurations

The fix ensures that malformed JSON in MCP config sections
will now be caught and reported during validation.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Signed-off-by: majiayu000 <1835304752@qq.com>
Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-30 09:54:27 +01:00
..
application_config.go feat(api): Allow tracing of requests and responses (#7609) 2025-12-29 11:06:06 +01:00
application_config_test.go feat(watchdog): add Memory resource reclaimer (#7583) 2025-12-16 09:15:18 +01:00
config_suite_test.go dependencies(grpcio): bump to fix CI issues (#2362) 2024-05-21 14:33:47 +02:00
gallery.go refactor: gallery inconsistencies (#2647) 2024-06-24 17:32:12 +02:00
gguf.go chore(refactor): move logging to common package based on slog (#7668) 2025-12-21 19:33:13 +01:00
guesser.go chore(refactor): move logging to common package based on slog (#7668) 2025-12-21 19:33:13 +01:00
model_config.go fix: propagate validation errors (#7787) 2025-12-30 09:54:27 +01:00
model_config_filter.go fix(config): make syncKnownUsecasesFromString idempotent (#7493) 2025-12-09 21:08:22 +01:00
model_config_loader.go fix: propagate validation errors (#7787) 2025-12-30 09:54:27 +01:00
model_config_test.go fix: propagate validation errors (#7787) 2025-12-30 09:54:27 +01:00
model_test.go feat: Add Agentic MCP support with a new chat/completion endpoint (#6381) 2025-10-05 17:51:41 +02:00
runtime_settings.go feat(api): Allow tracing of requests and responses (#7609) 2025-12-29 11:06:06 +01:00