diff --git a/autogpt_platform/frontend/src/app/(platform)/copilot/tools/DecomposeGoal/DecomposeGoal.tsx b/autogpt_platform/frontend/src/app/(platform)/copilot/tools/DecomposeGoal/DecomposeGoal.tsx index 6b3800156e..25c302ce5e 100644 --- a/autogpt_platform/frontend/src/app/(platform)/copilot/tools/DecomposeGoal/DecomposeGoal.tsx +++ b/autogpt_platform/frontend/src/app/(platform)/copilot/tools/DecomposeGoal/DecomposeGoal.tsx @@ -133,10 +133,12 @@ export function DecomposeGoalTool({ const filledSteps = editableStepsRef.current.filter((s) => s.description.trim(), ); - const list = filledSteps - .map((s, i) => `${i + 1}. ${s.description}`) - .join("; "); - return `Approved with modifications. Please build the agent following these steps: ${list}`; + if (filledSteps.length > 0) { + const list = filledSteps + .map((s, i) => `${i + 1}. ${s.description}`) + .join("; "); + return `Approved with modifications. Please build the agent following these steps: ${list}`; + } } return "Approved. Please build the agent."; }