Skip to main content

register_code_mode_tools

Function register_code_mode_tools 

Source
pub fn register_code_mode_tools(
    builder: ServerBuilder,
    config: &ServerConfig,
) -> Result<ServerBuilder>
Expand description

Tolerant builder-extension entry point for [code_mode] config — the CONNECTORLESS, validation-only / no-tool path.

Used by crate::builder_ext::ServerBuilderExt::try_code_mode_from_config (the connectorless companion). It is deliberately tolerant of config.code_mode = None (returns the builder unchanged) so callers can invoke it unconditionally — code-mode is opt-in at the config level.

When [code_mode] IS present, this helper drives validation_pipeline_from_config to surface R9 enforcement errors (inline token_secret rejection) before the builder reaches .build(), but registers NO tools because there is no executor to bind to. The tool-registering path is crate::builder_ext::ServerBuilderExt::try_code_mode_from_config_with_connector (which delegates to code_mode_tools_from_executor).

§Errors

Returns every error from validation_pipeline_from_config when config.code_mode.is_some(). No errors when config.code_mode.is_none().