diff --git a/front/lib/api/assistant/global_agents.ts b/front/lib/api/assistant/global_agents.ts index 5fe4e458cb2f..069ebef799ee 100644 --- a/front/lib/api/assistant/global_agents.ts +++ b/front/lib/api/assistant/global_agents.ts @@ -6,6 +6,7 @@ const readFileAsync = promisify(fs.readFile); import type { AgentActionConfigurationType, + AgentConfigurationStatus, AgentConfigurationType, AgentModelConfigurationType, ConnectorProvider, @@ -216,10 +217,20 @@ function _getGPT35TurboGlobalAgent({ function _getGPT4GlobalAgent({ auth, + settings, }: { auth: Authenticator; + settings: GlobalAgentSettings | null; }): AgentConfigurationType { - const status = !auth.isUpgraded() ? "disabled_free_workspace" : "active"; + let status: AgentConfigurationStatus = "active"; + + if (settings) { + status = settings.status; + } + if (!auth.isUpgraded()) { + status = "disabled_free_workspace"; + } + return { id: -1, sId: GLOBAL_AGENTS_SID.GPT4, @@ -1044,7 +1055,7 @@ function getGlobalAgent( agentConfiguration = _getGPT35TurboGlobalAgent({ settings }); break; case GLOBAL_AGENTS_SID.GPT4: - agentConfiguration = _getGPT4GlobalAgent({ auth }); + agentConfiguration = _getGPT4GlobalAgent({ auth, settings }); break; case GLOBAL_AGENTS_SID.CLAUDE_INSTANT: agentConfiguration = _getClaudeInstantGlobalAgent({ settings });