Add concurrent agent

This commit is contained in:
Marian Paul
2026-01-21 15:17:01 +01:00
parent 71f3271274
commit 409560fb97
5 changed files with 64 additions and 2 deletions

View File

@@ -81,6 +81,7 @@ class Schedule(Base):
# Agent configuration for scheduled runs
yolo_mode = Column(Boolean, nullable=False, default=False)
model = Column(String(50), nullable=True) # None = use global default
max_concurrency = Column(Integer, nullable=False, default=3) # 1-5 concurrent agents
# Crash recovery tracking
crash_count = Column(Integer, nullable=False, default=0) # Resets at window start
@@ -104,6 +105,7 @@ class Schedule(Base):
"enabled": self.enabled,
"yolo_mode": self.yolo_mode,
"model": self.model,
"max_concurrency": self.max_concurrency,
"crash_count": self.crash_count,
"created_at": self.created_at.isoformat() if self.created_at else None,
}
@@ -275,6 +277,14 @@ def _migrate_add_schedules_tables(engine) -> None:
)
conn.commit()
# Add max_concurrency column if missing (for upgrades)
if "max_concurrency" not in columns:
with engine.connect() as conn:
conn.execute(
text("ALTER TABLE schedules ADD COLUMN max_concurrency INTEGER DEFAULT 3")
)
conn.commit()
def create_database(project_dir: Path) -> tuple:
"""