WIP v0.2.0: pannello /endpoint e nomi abbreviati dei modelli (in pausa, non compilato)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -76,6 +76,17 @@ impl Session {
|
||||
{
|
||||
warn!("failed to refresh critical path timing config: {err}");
|
||||
}
|
||||
// Per-model settings of the active provider apply to new turns without a restart.
|
||||
let refresh_model_settings = !matches!(scope, RuntimeConfigRefresh::Mcp);
|
||||
if refresh_model_settings
|
||||
&& let Some(next) = next_config.model_providers.get(&config.model_provider_id)
|
||||
{
|
||||
let models = next.models.clone();
|
||||
if let Some(provider) = config.model_providers.get_mut(&config.model_provider_id) {
|
||||
provider.models = models.clone();
|
||||
}
|
||||
config.model_provider.models = models;
|
||||
}
|
||||
let config = Arc::new(config);
|
||||
let notify_contributors = !matches!(scope, RuntimeConfigRefresh::Mcp)
|
||||
&& !self.services.extensions.config_contributors().is_empty();
|
||||
@@ -108,6 +119,13 @@ impl Session {
|
||||
let previous_config = notify_contributors
|
||||
.then(|| self.build_effective_session_config(&state.session_configuration));
|
||||
state.session_configuration.original_config_do_not_use = Arc::clone(&config);
|
||||
if refresh_model_settings {
|
||||
state.session_configuration.model_info_overrides.context_windows =
|
||||
config.model_context_windows();
|
||||
self.services
|
||||
.model_client
|
||||
.set_model_settings(config.model_provider.models.clone());
|
||||
}
|
||||
if matches!(scope, RuntimeConfigRefresh::Mcp) {
|
||||
self.services.mcp_runtime.invalidate_resource_caches();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user