fix: show user warning when using default fallback metadata (#11690)

### What
It's currently unclear when the harness falls back to the default,
generic `ModelInfo`. This happens when the `remote_models` feature is
disabled or the model is truly unknown, and can lead to bad performance
and issues in the harness.

Add a user-facing warning when this happens so they are aware when their
setup is broken.

### Tests
Added tests, tested locally.
This commit is contained in:
sayan-oai
2026-02-15 18:46:05 -08:00
committed by GitHub
Unverified
parent 85034b189e
commit 060a320e7d
13 changed files with 76 additions and 8 deletions
+14 -5
View File
@@ -1780,13 +1780,11 @@ impl Session {
}
}
let resolved_model_slug = session_configuration.collaboration_mode.model().to_string();
let model_info = self
.services
.models_manager
.get_model_info(
session_configuration.collaboration_mode.model(),
&per_turn_config,
)
.get_model_info(resolved_model_slug.as_str(), &per_turn_config)
.await;
let mut turn_context: TurnContext = Self::make_turn_context(
Some(Arc::clone(&self.services.auth_manager)),
@@ -1794,7 +1792,7 @@ impl Session {
session_configuration.provider.clone(),
&session_configuration,
per_turn_config,
model_info,
model_info.clone(),
self.services
.network_proxy
.as_ref()
@@ -1807,6 +1805,17 @@ impl Session {
turn_context.final_output_json_schema = final_schema;
}
let turn_context = Arc::new(turn_context);
if model_info.used_fallback_model_metadata {
self.send_event(
turn_context.as_ref(),
EventMsg::Warning(WarningEvent {
message: format!(
"Model metadata for `{resolved_model_slug}` not found. Defaulting to fallback metadata; this can degrade performance and cause issues."
),
}),
)
.await;
}
turn_context.turn_metadata_state.spawn_git_enrichment_task();
turn_context
}