feat: give the curator continuous context and durable idea history

This commit is contained in:
wuyang
2026-07-28 17:31:37 +08:00
parent 5c483536b4
commit af7bb68268
10 changed files with 967 additions and 114 deletions
+28 -1
View File
@@ -276,7 +276,12 @@ def _redacted_event(event: dict[str, Any]) -> dict[str, Any]:
safe = payload
elif event_type == "context_loaded":
safe = payload
elif event_type in {"attempt_started", "model_attempt_completed"}:
elif event_type in {
"attempt_started",
"model_round_completed",
"model_attempt_completed",
"convergence_repair_started",
}:
safe = payload
elif event_type == "tool_search_ideas":
safe = {"result_count": payload.get("result_count", 0)}
@@ -341,6 +346,28 @@ async def admin_run_detail(
}
@app.post(
"/api/admin/runs/{run_id}/retry",
status_code=status.HTTP_202_ACCEPTED,
)
async def retry_admin_run(
run_id: str, admin: AuthUser = Depends(administrator)
):
retry = db.prepare_agent_retry(run_id)
if not retry:
raise HTTPException(
status_code=status.HTTP_409_CONFLICT,
detail="这次分析现在不能重新运行",
)
curator.enqueue(retry["fragment_id"])
db.add_audit_event(
"agent_run_requeued",
admin.id,
{"run_id": run_id, "owner_user_id": retry["user_id"]},
)
return {"queued": True}
static_dir = Path(__file__).parent / "static"
assets_dir = static_dir / "assets"
if assets_dir.is_dir():