agentLoadModeValidationError function

String? agentLoadModeValidationError(
  1. Object? value
)

Validates one agent.mode value (issue #680): null when value is a legal agentLoadModeLabels label, else the error text. The single source shared by the boot parser (cli_config.dart) and the settings validator (config_service.dart) — both throw it as a ConfigException, so the rule cannot drift between the two parsers.

Implementation

String? agentLoadModeValidationError(Object? value) {
  if (value is String && agentLoadModeLabels.contains(value)) return null;
  return '"agent.mode" must be one of: ${agentLoadModeLabels.join(', ')}';
}