From d892b66580f8a7240dc7250f63d06130bff3e079 Mon Sep 17 00:00:00 2001 From: anvyle Date: Tue, 14 Apr 2026 22:36:41 +0200 Subject: [PATCH] fix(copilot): fall back to default approval when all step descriptions are empty MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If the user cleared all step descriptions without deleting the steps, buildMessage() produced "Approved with modifications. Please build the agent following these steps: " — a dangling colon with no actual steps. Now falls back to the standard "Approved. Please build the agent." when filledSteps is empty after filtering. Co-Authored-By: Claude Sonnet 4.6 --- .../copilot/tools/DecomposeGoal/DecomposeGoal.tsx | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) 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."; }