From 8af2db7237298e89cedba1049fdd0f3fefd3e9af Mon Sep 17 00:00:00 2001 From: Diego Imbert Date: Wed, 15 Jul 2026 13:45:47 +0200 Subject: [PATCH] fix: activate free AI tier when clearing a workspace provider edit_copilot_config returned AIConfig::default() when the saved workspace config had no providers and no instance config existed; the frontend applies that response immediately, disabling AI even though the free-tier key is available. A later get_copilot_info (on reload) returns the synthetic free-tier config, so clearing a provider behaved inconsistently until reload. Give this response path the same free-tier fallback as get_copilot_info. Co-Authored-By: Claude Opus 4.8 (1M context) --- backend/windmill-api/src/workspaces.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/backend/windmill-api/src/workspaces.rs b/backend/windmill-api/src/workspaces.rs index 76fa2f74bf..df8cbaef87 100644 --- a/backend/windmill-api/src/workspaces.rs +++ b/backend/windmill-api/src/workspaces.rs @@ -154,6 +154,13 @@ async fn edit_copilot_config( ai_config } else if let Some(instance_ai_config) = instance_ai_config { serde_json::from_value::(instance_ai_config).unwrap_or_default() + } else if let Some(free_config) = + crate::ai_free_tier_oss::free_tier_copilot_config(&db, &authed.email).await? + { + // Same fallback as get_copilot_info: with nothing configured, surface Windmill's free + // tier (EE-only) so clearing a workspace provider activates it immediately, instead of + // returning an empty config that disables AI until the next page reload re-fetches it. + free_config } else { AIConfig::default() };