From ae6d890c706d3ad91238ef531629ab164dbdd0ed Mon Sep 17 00:00:00 2001 From: Lluis Agusti Date: Thu, 12 Feb 2026 23:02:16 +0800 Subject: [PATCH] fix: make it poll more often and keep expandedd --- .../api/features/chat/tools/agent_generator/dummy.py | 6 ++++-- .../(platform)/copilot/hooks/useLongRunningToolPolling.ts | 2 +- .../(platform)/copilot/tools/CreateAgent/CreateAgent.tsx | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/autogpt_platform/backend/backend/api/features/chat/tools/agent_generator/dummy.py b/autogpt_platform/backend/backend/api/features/chat/tools/agent_generator/dummy.py index c787dfee3c..cf0e76d3b3 100644 --- a/autogpt_platform/backend/backend/api/features/chat/tools/agent_generator/dummy.py +++ b/autogpt_platform/backend/backend/api/features/chat/tools/agent_generator/dummy.py @@ -6,6 +6,7 @@ Enable via AGENTGENERATOR_USE_DUMMY=true in settings. WARNING: This is for testing only. Do not use in production. """ +import asyncio import logging import uuid from typing import Any @@ -103,8 +104,9 @@ async def generate_agent_dummy( operation_id: str | None = None, task_id: str | None = None, ) -> dict[str, Any]: - """Return dummy agent JSON.""" - logger.info("Using dummy agent generator for generate_agent") + """Return dummy agent JSON after a simulated delay.""" + logger.info("Using dummy agent generator for generate_agent (30s delay)") + await asyncio.sleep(30) return _generate_dummy_agent_json() diff --git a/autogpt_platform/frontend/src/app/(platform)/copilot/hooks/useLongRunningToolPolling.ts b/autogpt_platform/frontend/src/app/(platform)/copilot/hooks/useLongRunningToolPolling.ts index b9e77538fb..e575857b0b 100644 --- a/autogpt_platform/frontend/src/app/(platform)/copilot/hooks/useLongRunningToolPolling.ts +++ b/autogpt_platform/frontend/src/app/(platform)/copilot/hooks/useLongRunningToolPolling.ts @@ -10,7 +10,7 @@ const OPERATING_TYPES = new Set([ "operation_in_progress", ]); -const POLL_INTERVAL_MS = 5_000; +const POLL_INTERVAL_MS = 1_500; /** * Detects whether any message contains a tool part whose output indicates diff --git a/autogpt_platform/frontend/src/app/(platform)/copilot/tools/CreateAgent/CreateAgent.tsx b/autogpt_platform/frontend/src/app/(platform)/copilot/tools/CreateAgent/CreateAgent.tsx index 88b1c491d7..1d3dbadfe7 100644 --- a/autogpt_platform/frontend/src/app/(platform)/copilot/tools/CreateAgent/CreateAgent.tsx +++ b/autogpt_platform/frontend/src/app/(platform)/copilot/tools/CreateAgent/CreateAgent.tsx @@ -52,7 +52,7 @@ function getAccordionMeta(output: CreateAgentToolOutput) { const icon = ; if (isAgentSavedOutput(output)) { - return { icon, title: output.agent_name }; + return { icon, title: output.agent_name, expanded: true }; } if (isAgentPreviewOutput(output)) { return {