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
levelfor the provider-qualifiedmodelat mutation time (command/settings).Errcarries a user-facing message; callers must not mutate state or persist config onErr.