Request schema for starting the agent.
| 180 | # ============================================================================ |
| 181 | |
| 182 | class AgentStartRequest(BaseModel): |
| 183 | """Request schema for starting the agent.""" |
| 184 | yolo_mode: bool | None = None # None means use global settings |
| 185 | model: str | None = None # None means use global settings |
| 186 | parallel_mode: bool | None = None # DEPRECATED: Use max_concurrency instead |
| 187 | max_concurrency: int | None = None # Max concurrent coding agents (1-5) |
| 188 | testing_agent_ratio: int | None = None # Regression testing agents (0-3) |
| 189 | |
| 190 | @field_validator('model') |
| 191 | @classmethod |
| 192 | def validate_model(cls, v: str | None) -> str | None: |
| 193 | """Validate model is in the allowed list.""" |
| 194 | if v is not None and v not in VALID_MODELS: |
| 195 | raise ValueError(f"Invalid model. Must be one of: {VALID_MODELS}") |
| 196 | return v |
| 197 | |
| 198 | @field_validator('max_concurrency') |
| 199 | @classmethod |
| 200 | def validate_concurrency(cls, v: int | None) -> int | None: |
| 201 | """Validate max_concurrency is between 1 and 5.""" |
| 202 | if v is not None and (v < 1 or v > 5): |
| 203 | raise ValueError("max_concurrency must be between 1 and 5") |
| 204 | return v |
| 205 | |
| 206 | @field_validator('testing_agent_ratio') |
| 207 | @classmethod |
| 208 | def validate_testing_ratio(cls, v: int | None) -> int | None: |
| 209 | """Validate testing_agent_ratio is between 0 and 3.""" |
| 210 | if v is not None and (v < 0 or v > 3): |
| 211 | raise ValueError("testing_agent_ratio must be between 0 and 3") |
| 212 | return v |
| 213 | |
| 214 | |
| 215 | class AgentStatus(BaseModel): |