mirror of
https://github.com/leonvanzyl/autocoder.git
synced 2026-01-30 06:12:06 +00:00
Add concurrent agent
This commit is contained in:
@@ -501,6 +501,12 @@ class ScheduleCreate(BaseModel):
|
||||
enabled: bool = True
|
||||
yolo_mode: bool = False
|
||||
model: str | None = None
|
||||
max_concurrency: int = Field(
|
||||
default=3,
|
||||
ge=1,
|
||||
le=5,
|
||||
description="Max concurrent agents (1-5)"
|
||||
)
|
||||
|
||||
@field_validator('model')
|
||||
@classmethod
|
||||
@@ -522,6 +528,7 @@ class ScheduleUpdate(BaseModel):
|
||||
enabled: bool | None = None
|
||||
yolo_mode: bool | None = None
|
||||
model: str | None = None
|
||||
max_concurrency: int | None = Field(None, ge=1, le=5)
|
||||
|
||||
@field_validator('model')
|
||||
@classmethod
|
||||
@@ -542,6 +549,7 @@ class ScheduleResponse(BaseModel):
|
||||
enabled: bool
|
||||
yolo_mode: bool
|
||||
model: str | None
|
||||
max_concurrency: int
|
||||
crash_count: int
|
||||
created_at: datetime
|
||||
|
||||
|
||||
@@ -368,10 +368,14 @@ class SchedulerService:
|
||||
logger.info(f"Agent already running for {project_name}, skipping scheduled start")
|
||||
return
|
||||
|
||||
logger.info(f"Starting agent for {project_name} (schedule {schedule.id}, yolo={schedule.yolo_mode})")
|
||||
logger.info(
|
||||
f"Starting agent for {project_name} "
|
||||
f"(schedule {schedule.id}, yolo={schedule.yolo_mode}, concurrency={schedule.max_concurrency})"
|
||||
)
|
||||
success, msg = await manager.start(
|
||||
yolo_mode=schedule.yolo_mode,
|
||||
model=schedule.model,
|
||||
max_concurrency=schedule.max_concurrency,
|
||||
)
|
||||
|
||||
if success:
|
||||
|
||||
Reference in New Issue
Block a user