MCPcopy Create free account
hub / github.com/AutoForgeAI/autoforge / update_project_settings

Function update_project_settings

server/routers/projects.py:489–524  ·  view source on GitHub ↗

Update project-level settings (concurrency, etc.).

(name: str, settings: ProjectSettingsUpdate)

Source from the content-addressed store, hash-verified

487
488@router.patch("/{name}/settings", response_model=ProjectDetail)
489async def update_project_settings(name: str, settings: ProjectSettingsUpdate):
490 """Update project-level settings (concurrency, etc.)."""
491 _init_imports()
492 assert _check_spec_exists is not None # guaranteed by _init_imports()
493 assert _get_project_prompts_dir is not None # guaranteed by _init_imports()
494 (_, _, get_project_path, _, _, get_project_concurrency,
495 set_project_concurrency) = _get_registry_functions()
496
497 name = validate_project_name(name)
498 project_dir = get_project_path(name)
499
500 if not project_dir:
501 raise HTTPException(status_code=404, detail=f"Project '{name}' not found")
502
503 if not project_dir.exists():
504 raise HTTPException(status_code=404, detail="Project directory not found")
505
506 # Update concurrency if provided
507 if settings.default_concurrency is not None:
508 success = set_project_concurrency(name, settings.default_concurrency)
509 if not success:
510 raise HTTPException(status_code=500, detail="Failed to update concurrency")
511
512 # Return updated project details
513 has_spec = _check_spec_exists(project_dir)
514 stats = get_project_stats(project_dir)
515 prompts_dir = _get_project_prompts_dir(project_dir)
516
517 return ProjectDetail(
518 name=name,
519 path=project_dir.as_posix(),
520 has_spec=has_spec,
521 stats=stats,
522 prompts_dir=str(prompts_dir),
523 default_concurrency=get_project_concurrency(name),
524 )

Callers

nothing calls this directly

Calls 8

get_project_pathFunction · 0.90
set_project_concurrencyFunction · 0.90
get_project_concurrencyFunction · 0.90
_init_importsFunction · 0.85
_get_registry_functionsFunction · 0.85
get_project_statsFunction · 0.85
validate_project_nameFunction · 0.70
ProjectDetailClass · 0.50

Tested by

no test coverage detected