Merge fix/three-bugs-2026-03-22: accept task_code/milestone_code as identifiers, add /config/status endpoint

This commit is contained in:
zhi
2026-03-22 10:56:34 +00:00
4 changed files with 95 additions and 48 deletions

View File

@@ -26,6 +26,26 @@ def health_check():
def version():
return {"name": "HarborForge", "version": "0.3.0", "description": "Agent/人类协同任务管理平台"}
@app.get("/config/status", tags=["System"])
def config_status():
"""Check if HarborForge has been initialized (reads from config volume).
Frontend uses this instead of contacting the wizard directly."""
import os, json
config_dir = os.getenv("CONFIG_DIR", "/config")
config_file = os.getenv("CONFIG_FILE", "harborforge.json")
config_path = os.path.join(config_dir, config_file)
if not os.path.exists(config_path):
return {"initialized": False}
try:
with open(config_path, "r") as f:
cfg = json.load(f)
return {
"initialized": cfg.get("initialized", False),
"backend_url": cfg.get("backend_url"),
}
except Exception:
return {"initialized": False}
# Register routers
from app.api.routers.auth import router as auth_router
from app.api.routers.tasks import router as tasks_router