feat(agents): reset button + fix comment routing fallback #331
Reference in New Issue
Block a user
Delete Branch "worktree-agent-reset"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
סיכום
שני תיקונים שנובעים מהאבחון של תיק 8174-12-24 שהיה תקוע עם כותב/בודק-איכות במצב שגיאה.
שינויים
1. תיקון ניתוב תגובות בפלאגין (plugin-legal-ai — כבר מוזג ב-
mainשל הפלאגין + pm2 restart)plugin-legal-ai/src/worker.ts: כאשרlistComments()נכשל, השתמש ב-bodySnippet(תמיד זמין) במקום לשלוח לCEO טקסט "(שגיאה בקריאת התגובה)". מוסיףwarnlog עם השגיאה האמיתית לאבחון עתידי. אם גםbodySnippetריק — שולח הוראה מפורשת ל-CEO לקרוא תגובות בעצמו.2. כפתור "איפוס סוכנים" (legal-ai)
web/paperclip_client.py:reset_case_agents(case_number)— מאפס issues תקועים + status שגיאה ב-Paperclip + קורא ל-reset_agent_sessionלכל סוכן שגויweb/agent_platform_port.py: מייצאpc_reset_case_agents(שמירת G12)web/app.py:POST /api/cases/{case_number}/agents/resetweb-ui/src/lib/api/agents.ts:useResetCaseAgentsmutation +AgentResetResulttypeweb-ui/src/components/cases/agent-status-widget.tsx: כפתור "אפס" (מוצג רק כשיש סוכן במצב שגיאה) + Dialog אישור + toast סיכוםInvariants
agent_platform_port.pyבלבד ✓reset_agent_session,pc_get_case_issues) — אין מסלול מקביל ✓בדיקה
bodySnippetבמקום שגיאהAdds a one-click 'reset agents' action for cases where writer/QA agents are stuck in Paperclip's error state (triggered by recovery loop or failed run). Addresses the root cause documented in reference_paperclip_recovery_loops: reassigns open issues from agents back to the chair user, and calls reset_agent_session for each error agent to clear wedged runtime sessions. Changes: - paperclip_client.py: reset_case_agents() — reassigns stuck issues + clears error status in Paperclip DB + calls reset_agent_session - agent_platform_port.py: exports pc_reset_case_agents (G12 gate) - app.py: POST /api/cases/{case_number}/agents/reset endpoint - agents.ts: useResetCaseAgents mutation hook + AgentResetResult type - agent-status-widget.tsx: 'אפס' button (shown only when error agents exist) with Dialog confirmation + loading state + toast feedback Invariants: G12 (Paperclip only via port), G2 (no parallel path — uses existing reset_agent_session + pc_get_case_issues). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>