Skip to content

Commit 4a60103

Browse files
Fix empty plan case (#465)
1 parent 003db36 commit 4a60103

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/magentic_ui/teams/orchestrator/_orchestrator.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -932,6 +932,12 @@ async def _orchestrate_step_planning(
932932
cancellation_token=cancellation_token,
933933
)
934934
self._state.in_planning_mode = False
935+
if self._state.plan is None:
936+
# produce final answer if no plan was created
937+
await self._prepare_final_answer(
938+
"No plan was created.", cancellation_token
939+
)
940+
return
935941
await self._orchestrate_step_execution(cancellation_token, first_step=True)
936942

937943
async def _orchestrate_step_execution(

0 commit comments

Comments
 (0)