Spaces:
Sleeping
Sleeping
debug: print full traceback in orchestrator; fix error check to use plan is None
Browse files- agents/orchestrator.py +3 -0
- app.py +2 -2
agents/orchestrator.py
CHANGED
|
@@ -1,6 +1,7 @@
|
|
| 1 |
"""Orchestrator — routes requests to specialized agents, runs them in parallel where possible, assembles final state. No AI model used."""
|
| 2 |
|
| 3 |
import asyncio
|
|
|
|
| 4 |
from core.planner import ProjectPlan, ERROR_MESSAGES
|
| 5 |
from agents import validate_agent, date_agent, plan_agent, risk_agent, refine_agent
|
| 6 |
|
|
@@ -80,6 +81,8 @@ async def generate(
|
|
| 80 |
"error": None,
|
| 81 |
}
|
| 82 |
except Exception as exc:
|
|
|
|
|
|
|
| 83 |
return {"error": str(exc), "plan": None}
|
| 84 |
|
| 85 |
|
|
|
|
| 1 |
"""Orchestrator — routes requests to specialized agents, runs them in parallel where possible, assembles final state. No AI model used."""
|
| 2 |
|
| 3 |
import asyncio
|
| 4 |
+
import traceback
|
| 5 |
from core.planner import ProjectPlan, ERROR_MESSAGES
|
| 6 |
from agents import validate_agent, date_agent, plan_agent, risk_agent, refine_agent
|
| 7 |
|
|
|
|
| 81 |
"error": None,
|
| 82 |
}
|
| 83 |
except Exception as exc:
|
| 84 |
+
print(f"[orchestrator.generate] EXCEPTION {type(exc).__name__}: {exc!r}")
|
| 85 |
+
traceback.print_exc()
|
| 86 |
return {"error": str(exc), "plan": None}
|
| 87 |
|
| 88 |
|
app.py
CHANGED
|
@@ -290,8 +290,8 @@ async def on_generate(objective, tasks, start_date, end_date, start_ai, end_ai,
|
|
| 290 |
)
|
| 291 |
return
|
| 292 |
|
| 293 |
-
# --- Step 4: Handle orchestrator error ---
|
| 294 |
-
if isinstance(result, dict) and result.get("
|
| 295 |
yield (
|
| 296 |
gr.update(value=None), # gantt_plot
|
| 297 |
gr.update(value=None), # raci_plot
|
|
|
|
| 290 |
)
|
| 291 |
return
|
| 292 |
|
| 293 |
+
# --- Step 4: Handle orchestrator error (treat empty string as error too) ---
|
| 294 |
+
if isinstance(result, dict) and result.get("plan") is None:
|
| 295 |
yield (
|
| 296 |
gr.update(value=None), # gantt_plot
|
| 297 |
gr.update(value=None), # raci_plot
|