mirror of
https://github.com/leonvanzyl/autocoder.git
synced 2026-01-30 22:32:06 +00:00
feat: persist concurrent agents slider at project level
Add `default_concurrency` column to the projects table in the registry
database, allowing each project to remember its preferred concurrency
setting (1-5 agents). The value persists across page refreshes and
app restarts.
Backend changes:
- Add `default_concurrency` column to Project model in registry.py
- Add database migration for existing databases (ALTER TABLE)
- Add get/set_project_concurrency() CRUD functions
- Add ProjectSettingsUpdate schema with validation
- Add PATCH /{name}/settings endpoint in projects router
- Include default_concurrency in ProjectSummary/ProjectDetail responses
Frontend changes:
- Add default_concurrency to ProjectSummary TypeScript interface
- Add ProjectSettingsUpdate type and updateProjectSettings API function
- Add useUpdateProjectSettings React Query mutation hook
- Update AgentControl to accept defaultConcurrency prop
- Sync local state when project changes via useEffect
- Debounce slider changes (500ms) before saving to backend
- Pass defaultConcurrency from selectedProjectData in App.tsx
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -45,6 +45,7 @@ class ProjectSummary(BaseModel):
|
||||
path: str
|
||||
has_spec: bool
|
||||
stats: ProjectStats
|
||||
default_concurrency: int = 3
|
||||
|
||||
|
||||
class ProjectDetail(BaseModel):
|
||||
@@ -54,6 +55,7 @@ class ProjectDetail(BaseModel):
|
||||
has_spec: bool
|
||||
stats: ProjectStats
|
||||
prompts_dir: str
|
||||
default_concurrency: int = 3
|
||||
|
||||
|
||||
class ProjectPrompts(BaseModel):
|
||||
@@ -70,6 +72,18 @@ class ProjectPromptsUpdate(BaseModel):
|
||||
coding_prompt: str | None = None
|
||||
|
||||
|
||||
class ProjectSettingsUpdate(BaseModel):
|
||||
"""Request schema for updating project-level settings."""
|
||||
default_concurrency: int | None = None
|
||||
|
||||
@field_validator('default_concurrency')
|
||||
@classmethod
|
||||
def validate_concurrency(cls, v: int | None) -> int | None:
|
||||
if v is not None and (v < 1 or v > 5):
|
||||
raise ValueError("default_concurrency must be between 1 and 5")
|
||||
return v
|
||||
|
||||
|
||||
# ============================================================================
|
||||
# Feature Schemas
|
||||
# ============================================================================
|
||||
|
||||
Reference in New Issue
Block a user