feat(agent-office): service_proxy pipeline_retry/list_failed_pipelines (+ music-lab status=failed 필터)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-06-12 00:33:28 +09:00
parent ef1a7a92fd
commit d048251a97
4 changed files with 53 additions and 1 deletions

View File

@@ -1135,6 +1135,21 @@ def list_pipelines(active_only: bool = False) -> List[Dict[str, Any]]:
return [_parse_pipeline_row(r) for r in rows]
def list_pipelines_by_state(state: str) -> List[Dict[str, Any]]:
"""특정 state의 파이프라인만 조회 (예: 'failed')."""
sql = """
SELECT vp.*, ml.title AS track_title, cj.title AS compile_title
FROM video_pipelines vp
LEFT JOIN music_library ml ON ml.id = vp.track_id
LEFT JOIN compile_jobs cj ON cj.id = vp.compile_job_id
WHERE vp.state = ?
ORDER BY vp.created_at DESC
"""
with _conn() as conn:
rows = conn.execute(sql, (state,)).fetchall()
return [_parse_pipeline_row(r) for r in rows]
def increment_feedback_count(pid: int, step: str) -> int:
"""원자적으로 feedback_count_per_step.<step>를 +1 한 뒤 새 값을 반환.

View File

@@ -1030,7 +1030,12 @@ def create_pipeline(req: PipelineCreate):
@app.get("/api/music/pipeline")
def list_pipelines_endpoint(status: str = "all"):
pipelines = _db_module.list_pipelines(active_only=(status == "active"))
if status == "active":
pipelines = _db_module.list_pipelines(active_only=True)
elif status == "failed":
pipelines = _db_module.list_pipelines_by_state("failed")
else:
pipelines = _db_module.list_pipelines(active_only=False)
return {"pipelines": pipelines}