diff --git a/autogpt_platform/backend/backend/copilot/sdk/agent_generation_guide.md b/autogpt_platform/backend/backend/copilot/sdk/agent_generation_guide.md index 00750e3b1f..efa3ebeed3 100644 --- a/autogpt_platform/backend/backend/copilot/sdk/agent_generation_guide.md +++ b/autogpt_platform/backend/backend/copilot/sdk/agent_generation_guide.md @@ -37,7 +37,7 @@ Before running the workflow below, ALWAYS decompose the goal first: 4. Only after approval, continue with "Workflow for Creating/Editing Agents". For simple goals (1-2 blocks), keep steps brief (2-3 steps). -For complex goals, decompose into 4-8 steps max. +For complex goals, use as many steps as needed. ### Workflow for Creating/Editing Agents diff --git a/autogpt_platform/backend/backend/copilot/tools/decompose_goal.py b/autogpt_platform/backend/backend/copilot/tools/decompose_goal.py index 925336a9a3..36d7f1d4f9 100644 --- a/autogpt_platform/backend/backend/copilot/tools/decompose_goal.py +++ b/autogpt_platform/backend/backend/copilot/tools/decompose_goal.py @@ -18,8 +18,6 @@ from .models import ( logger = logging.getLogger(__name__) -# Matches the guide's "4-8 steps max" constraint. -MAX_STEPS = 8 DEFAULT_ACTION = "add_block" VALID_ACTIONS = {"add_block", "connect_blocks", "configure", "add_input", "add_output"} @@ -275,13 +273,6 @@ class DecomposeGoalTool(BaseTool): session_id=session_id, ) - if len(steps) > MAX_STEPS: - return ErrorResponse( - message=f"Too many steps ({len(steps)}). Keep the plan to {MAX_STEPS} steps max.", - error="too_many_steps", - session_id=session_id, - ) - decomposition_steps: list[DecompositionStepModel] = [] for i, step in enumerate(steps): if not isinstance(step, dict): diff --git a/autogpt_platform/backend/backend/copilot/tools/decompose_goal_test.py b/autogpt_platform/backend/backend/copilot/tools/decompose_goal_test.py index e234aa3a5f..51d99d0434 100644 --- a/autogpt_platform/backend/backend/copilot/tools/decompose_goal_test.py +++ b/autogpt_platform/backend/backend/copilot/tools/decompose_goal_test.py @@ -13,7 +13,6 @@ from ._test_data import make_session from .decompose_goal import ( AUTO_APPROVE_CLIENT_SECONDS, DEFAULT_ACTION, - MAX_STEPS, DecomposeGoalTool, _no_user_action_since, cancel_auto_approve, @@ -190,38 +189,6 @@ async def test_empty_steps_returns_error(tool: DecomposeGoalTool, session): assert result.error == "missing_steps" -@pytest.mark.asyncio -async def test_too_many_steps_returns_error(tool: DecomposeGoalTool, session): - many_steps = [ - {"description": f"Step {i}", "action": "add_block"} - for i in range(MAX_STEPS + 1) - ] - result = await tool._execute( - user_id=_USER_ID, - session=session, - goal="Over-engineered agent", - steps=many_steps, - ) - assert isinstance(result, ErrorResponse) - assert result.error == "too_many_steps" - - -@pytest.mark.asyncio -async def test_exactly_max_steps_succeeds(tool: DecomposeGoalTool, session): - """Exactly MAX_STEPS steps should succeed.""" - max_steps = [ - {"description": f"Step {i}", "action": "add_block"} for i in range(MAX_STEPS) - ] - result = await tool._execute( - user_id=_USER_ID, - session=session, - goal="Complex agent", - steps=max_steps, - ) - assert isinstance(result, TaskDecompositionResponse) - assert len(result.steps) == MAX_STEPS - - # --------------------------------------------------------------------------- # Validation — malformed step items # ---------------------------------------------------------------------------