Skip to main content

Module validation

Module validation 

Source
Expand description

Shared mutation-time reasoning validation and dynamic option derivation.

Single source of truth for “may this provider-qualified model accept this ReasoningLevel?” — used by Runtime::set_reasoning_level_checked (slash commands, settings) and by dynamic TUI option derivation. Capability data comes from the process-local capability cache (live catalogs) first, then the exact static descriptor tables. No model-name substring inference: dispatch keys on the provider-qualified id prefix only (bare claude-* ids are Anthropic routing parity with resolve_route).

Functions§

default_level_for_model
Model-default reasoning level applied on model switch when the user has not explicitly chosen a level. None = leave the current level untouched.
reasoning_type_for_model
Human-readable reasoning type for the settings UI, derived from the same exact capability sources as thinking_options_for_model (capability cache first, then exact static descriptors). Never claims a verified type for providers without authoritative metadata.
thinking_options_for_model
Dynamic thinking options for the settings UI, derived from exact catalog/static capabilities for the provider-qualified model id.
validate_reasoning_mutation
Validate level for the provider-qualified model at mutation time (command/settings). Err carries a user-facing message; callers must not mutate state or persist config on Err.