mirror of
https://github.com/Significant-Gravitas/AutoGPT.git
synced 2026-04-30 03:00:41 -04:00
fix(frontend/copilot): guard isPending flag on error and filter empty steps from approval
- Prevent simultaneous pending + error state when output-error has null payload: isPending is now false when isError is true - Filter out steps with empty descriptions before building the approval message, preventing malformed input from reaching the LLM Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -56,7 +56,7 @@ export function DecomposeGoalTool({ part, isLastMessage }: Props) {
|
||||
const output = getDecomposeGoalOutput(part);
|
||||
const isError =
|
||||
part.state === "output-error" || (!!output && isErrorOutput(output));
|
||||
const isPending = !output;
|
||||
const isPending = !output && !isError;
|
||||
|
||||
const showActions =
|
||||
!!isLastMessage &&
|
||||
@@ -80,7 +80,10 @@ export function DecomposeGoalTool({ part, isLastMessage }: Props) {
|
||||
|
||||
function buildMessage() {
|
||||
if (isEditingRef.current && editableStepsRef.current.length > 0) {
|
||||
const list = editableStepsRef.current
|
||||
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}`;
|
||||
|
||||
Reference in New Issue
Block a user