Skip to content

Commit 24b785e

Browse files
authored
chore: futher add more time for running (#994)
1 parent 9fbdd1c commit 24b785e

6 files changed

Lines changed: 10 additions & 8 deletions

File tree

backend/app/component/model_validation.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,14 @@ def create_agent(
2929
model_type=mtype,
3030
api_key=api_key,
3131
url=url,
32-
timeout=10,
32+
timeout=60, # 1 minute for validation
3333
model_config_dict=model_config_dict,
3434
**kwargs,
3535
)
3636
agent = ChatAgent(
3737
system_message="You are a helpful assistant that must use the tool get_website_content to get the content of a website.",
3838
model=model,
3939
tools=[get_website_content],
40-
step_timeout=900,
40+
step_timeout=1800, # 30 minutes
4141
)
4242
return agent

backend/app/controller/chat_controller.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@
3636
# Create traceroot logger for chat controller
3737
chat_logger = traceroot.get_logger("chat_controller")
3838

39-
# SSE timeout configuration (30 minutes in seconds)
40-
SSE_TIMEOUT_SECONDS = 30 * 60
39+
# SSE timeout configuration (60 minutes in seconds)
40+
SSE_TIMEOUT_SECONDS = 60 * 60
4141

4242

4343
async def _cleanup_task_lock_safe(task_lock, reason: str) -> bool:

backend/app/service/chat_service.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ def collect_previous_task_context(working_directory: str, previous_task_content:
154154
return "\n".join(context_parts)
155155

156156

157-
def check_conversation_history_length(task_lock: TaskLock, max_length: int = 100000) -> tuple[bool, int]:
157+
def check_conversation_history_length(task_lock: TaskLock, max_length: int = 200000) -> tuple[bool, int]:
158158
"""
159159
Check if conversation history exceeds maximum length
160160

backend/app/service/task.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -503,7 +503,7 @@ async def _periodic_cleanup():
503503
await asyncio.sleep(300) # Run every 5 minutes
504504

505505
current_time = datetime.now()
506-
stale_timeout = timedelta(hours=2) # Consider tasks stale after 2 hours
506+
stale_timeout = timedelta(hours=4) # Consider tasks stale after 4 hours
507507

508508
stale_ids = []
509509
for task_id, task_lock in task_locks.items():

backend/app/utils/agent.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ def __init__(
173173
pause_event: asyncio.Event | None = None,
174174
prune_tool_calls_from_memory: bool = False,
175175
enable_snapshot_clean: bool = False,
176-
step_timeout: float | None = 900,
176+
step_timeout: float | None = 1800, # 30 minutes
177177
**kwargs: Any,
178178
) -> None:
179179
super().__init__(
@@ -805,6 +805,7 @@ def agent_model(
805805
api_key=options.api_key,
806806
url=options.api_url,
807807
model_config_dict=model_config or None,
808+
timeout=600, # 10 minutes
808809
**init_params,
809810
)
810811

@@ -1855,6 +1856,7 @@ async def mcp_agent(options: Chat):
18551856
if options.is_cloud()
18561857
else None
18571858
),
1859+
timeout=600, # 10 minutes
18581860
**{
18591861
k: v
18601862
for k, v in (options.extra_params or {}).items()

backend/app/utils/workforce.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ def __init__(
6161
graceful_shutdown_timeout=graceful_shutdown_timeout,
6262
share_memory=share_memory,
6363
use_structured_output_handler=use_structured_output_handler,
64-
task_timeout_seconds=1800, # 30 minutes
64+
task_timeout_seconds=3600, # 60 minutes
6565
failure_handling_config=FailureHandlingConfig(
6666
enabled_strategies=["retry", "replan"],
6767
),

0 commit comments

Comments
 (0)