feat: add TOML validation for Codex config and improve code formatting
- Add real-time TOML syntax validation for Codex config field - Validate config TOML when saving provider settings - Format code to improve readability with proper error handling blocks - Reorganize imports for better consistency This ensures Codex config is valid TOML before saving, preventing runtime errors.
This commit is contained in:
@@ -32,6 +32,9 @@ fn validate_provider_settings(app_type: &AppType, provider: &Provider) -> Result
|
||||
if !(config_value.is_string() || config_value.is_null()) {
|
||||
return Err("Codex config 字段必须是字符串".to_string());
|
||||
}
|
||||
if let Some(cfg_text) = config_value.as_str() {
|
||||
codex_config::validate_config_toml(cfg_text)?;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user