fix: tini entrypoint, event routing wildcard, orphan recovery
This commit is contained in:
@@ -62,7 +62,7 @@ async def gitea_webhook(request: Request):
|
||||
|
||||
if event_type == "push":
|
||||
await handle_push(payload)
|
||||
elif event_type in ("pull_request", "pull_request_approved", "pull_request_review_approved"):
|
||||
elif event_type.startswith("pull_request"):
|
||||
await handle_pr(payload)
|
||||
elif event_type == "status":
|
||||
await handle_ci_status(payload)
|
||||
|
||||
@@ -122,6 +122,17 @@ async def handle_work_item_created(data: dict):
|
||||
|
||||
logger.info(f"Task created: {work_item_id} ({name}), branch={branch}, stage=analysis")
|
||||
|
||||
# Launch analyst agent
|
||||
try:
|
||||
task_row = get_db().execute("SELECT id FROM tasks WHERE work_item_id=?", (work_item_id,)).fetchone()
|
||||
if task_row:
|
||||
task_id = task_row[0]
|
||||
task_desc = f"Work item: {work_item_id}\nRepo: {repo}\nBranch: {branch}\nStage: analysis\nTitle: {name}"
|
||||
run_id = launcher.launch("analyst", repo, task_desc, task_id=task_id)
|
||||
logger.info(f"Task {task_id}: launched analyst (run_id={run_id})")
|
||||
except Exception as e:
|
||||
logger.error(f"Failed to launch analyst for {work_item_id}: {e}")
|
||||
|
||||
|
||||
async def handle_comment(data: dict):
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user