fix: start-workflow wakeup failure now returns 502 instead of silent success
All checks were successful
Build & Deploy / build-and-deploy (push) Successful in 1m33s
All checks were successful
Build & Deploy / build-and-deploy (push) Successful in 1m33s
If pc_wake_ceo fails, the endpoint now raises HTTP 502 and skips the case_update to processing — preventing cases from silently getting stuck with no CEO running. Also adds `processing` to CEO routing table and updates case_list docstring with full status list. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -585,6 +585,7 @@ Paperclip חוסם אוטומטית כל issue ב-`in_progress` שאין לו ru
|
||||
|
||||
| סטטוס | מי שינה לזה | פעולה הבאה |
|
||||
|--------|-------------|------------|
|
||||
| `processing` | start-workflow (ממשק) | → בדוק אם כבר קיים issue פעיל לסוכן משנה. אם לא → המשך ל-§A כרגיל (בדוק documents + claims) |
|
||||
| `new` | (יצירת תיק) | → בדוק extraction_status של מסמכים. אם יש `pending` → צור issue למגיה (410c0167). אם כולם `completed`/`proofread` → צור issue למנתח |
|
||||
| `proofread` | מגיה | → צור issue למנתח משפטי (ראה תבנית למטה) |
|
||||
| `documents_ready` | מנתח | → שלב A (בדיקות שלמות + שליליות + מתודולוגיה). אם עובר → עדכן ל-`analyst_verified` |
|
||||
|
||||
@@ -237,7 +237,10 @@ async def case_list(status: str = "", limit: int = 50) -> str:
|
||||
"""רשימת תיקי ערר עם אפשרות סינון לפי סטטוס.
|
||||
|
||||
Args:
|
||||
status: סינון לפי סטטוס (new, in_progress, drafted, reviewed, final). ריק = הכל
|
||||
status: סינון לפי סטטוס (new, processing, proofread, documents_ready, analyst_verified,
|
||||
research_complete, outcome_set, direction_pending, direction_approved,
|
||||
analysis_enriched, ready_for_writing, drafted, qa_passed, qa_failed,
|
||||
exported, done). ריק = הכל
|
||||
limit: מספר תוצאות מקסימלי
|
||||
"""
|
||||
cases = await db.list_cases(status=status or None, limit=limit)
|
||||
|
||||
11
web/app.py
11
web/app.py
@@ -2588,14 +2588,17 @@ async def api_start_workflow(case_number: str):
|
||||
except Exception as e:
|
||||
raise HTTPException(502, f"שגיאת Paperclip: {e}")
|
||||
|
||||
# 3. Wake the CEO agent
|
||||
# 3. Wake the CEO agent — must succeed before marking case as processing
|
||||
try:
|
||||
wakeup = await pc_wake_ceo(issue["issue_id"], case_number, issue.get("company_id", ""))
|
||||
except Exception as e:
|
||||
logger.warning("CEO wakeup failed for case %s: %s", case_number, e)
|
||||
wakeup = {"error": str(e)}
|
||||
logger.error("CEO wakeup failed for case %s: %s", case_number, e)
|
||||
raise HTTPException(
|
||||
502,
|
||||
f"נוצר issue {issue['identifier']} אך עירור ה-CEO נכשל: {e}. ניתן לנסות שנית.",
|
||||
)
|
||||
|
||||
# 4. Update case status to processing
|
||||
# 4. Update case status to processing (only after wakeup confirmed)
|
||||
await cases_tools.case_update(case_number, status="processing")
|
||||
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user