Fix orchestration and provider reliability
This commit is contained in:
@@ -80,6 +80,11 @@ pub(crate) async fn prepare_provider_run(
|
||||
let skill_path_origin = params.session_context.skill_path_origin();
|
||||
let max_context_tokens = params.context_window_limit;
|
||||
let mut cli_params = params.clone();
|
||||
let cli_model_is_placeholder = params.cli_agent_model.as_str().trim().is_empty()
|
||||
|| params
|
||||
.cli_agent_model
|
||||
.as_str()
|
||||
.eq_ignore_ascii_case("placeholder");
|
||||
let cli_provider_config = match cli_provider_config {
|
||||
crate::ai::provider::ProviderConfig::None => {
|
||||
// The CLI model can be absent from a model-specific provider routing table even when
|
||||
@@ -87,6 +92,14 @@ pub(crate) async fn prepare_provider_run(
|
||||
cli_params.model = params.model.clone();
|
||||
base_provider_config.clone()
|
||||
}
|
||||
provider_config if cli_model_is_placeholder => {
|
||||
// A placeholder CLI model is used while preferences are still
|
||||
// loading. Never send it to a provider: fall back to the working
|
||||
// base model so command monitoring cannot terminate the run with
|
||||
// a provider-side invalid-model error.
|
||||
cli_params.model = params.model.clone();
|
||||
base_provider_config.clone()
|
||||
}
|
||||
provider_config => {
|
||||
cli_params.model = params.cli_agent_model.clone();
|
||||
provider_config
|
||||
|
||||
Reference in New Issue
Block a user