diff --git a/plugins/automation/README.md b/plugins/automation/README.md index c3613bf..c7c97c2 100644 --- a/plugins/automation/README.md +++ b/plugins/automation/README.md @@ -110,7 +110,6 @@ All operations use a consistent 3-parameter structure: - `session_id`: Session ID for conversation context - `model`: Model to use (e.g., "haiku", "gpt-4") - `cli_type`: CLI to use ("claude", "codex", "copilot") - - `focus_areas`: Array of specific areas to focus on - `working_directories`: Array of working directory paths ### Operations @@ -270,13 +269,12 @@ The tool maintains session-based agents. Use the same `session_id` in the `conte ### ExploreAgent Methods -#### `explore(question, codebase_path=None, focus_areas=None)` +#### `explore(question, codebase_path=None)` General exploration method for any codebase question. ```python answer = await agent.explore( - "Where is the database connection configured?", - focus_areas=["config", "database"] + "Where is the database connection configured?" ) ``` diff --git a/plugins/automation/agents/explore_agent.py b/plugins/automation/agents/explore_agent.py index 9435b59..4df7218 100644 --- a/plugins/automation/agents/explore_agent.py +++ b/plugins/automation/agents/explore_agent.py @@ -180,7 +180,6 @@ def _get_exploration_instructions(self) -> str: def prepare_context( self, codebase_path: Optional[str] = None, - focus_areas: Optional[List[str]] = None, **kwargs ) -> Optional[str]: """ @@ -188,7 +187,6 @@ def prepare_context( Args: codebase_path: Path to the codebase root - focus_areas: Specific areas or components to focus on **kwargs: Additional context parameters Returns: @@ -209,11 +207,6 @@ def prepare_context( if self.config.cwd: context_parts.append(f"**Current Directory**: `{self.config.cwd}`") - # Add focus areas if provided - if focus_areas: - areas = "\n".join([f" - {area}" for area in focus_areas]) - context_parts.append(f"**Focus Areas**:\n{areas}") - # Add search paths if configured if self.explore_config.search_paths: paths = "\n".join([f" - `{p}`" for p in self.explore_config.search_paths]) @@ -228,7 +221,6 @@ async def explore( self, question: str, codebase_path: Optional[str] = None, - focus_areas: Optional[List[str]] = None, ) -> str: """ Explore the codebase to answer a specific question. @@ -236,7 +228,6 @@ async def explore( Args: question: Question about the codebase codebase_path: Path to the codebase root - focus_areas: Specific areas to focus on Returns: Answer with code locations and explanations @@ -244,7 +235,6 @@ async def explore( return await self.invoke( prompt=question, codebase_path=codebase_path, - focus_areas=focus_areas, ) async def find_implementation( diff --git a/plugins/automation/tests/test_agent_tool.py b/plugins/automation/tests/test_agent_tool.py index 6de5751..9ea1a78 100644 --- a/plugins/automation/tests/test_agent_tool.py +++ b/plugins/automation/tests/test_agent_tool.py @@ -332,7 +332,6 @@ async def test_execute_with_full_context(self): "session_id": "custom-session", "model": "gpt-4", "cli_type": "codex", - "focus_areas": ["auth", "database"], "working_directories": ["/project/src"] } }) @@ -348,10 +347,6 @@ async def test_execute_with_full_context(self): assert call_args.kwargs["codebase_path"] == "/project" assert call_args.kwargs["working_directories"] == ["/project/src"] - # Verify focus_areas passed to explore - explore_call_args = mock_agent.explore.call_args - assert explore_call_args.kwargs["focus_areas"] == ["auth", "database"] - @pytest.mark.asyncio async def test_execute_invalid_operation(self): """Test execution with invalid operation""" diff --git a/plugins/automation/tests/test_ai_split_operation.py b/plugins/automation/tests/test_ai_split_operation.py index 1692b61..f32e75b 100644 --- a/plugins/automation/tests/test_ai_split_operation.py +++ b/plugins/automation/tests/test_ai_split_operation.py @@ -47,7 +47,6 @@ def test_build_split_prompt_basic(self): prompt = operation._build_split_prompt( goal="Understand authentication", codebase_path=None, - focus_areas=[], constraints=None, context="", min_tasks=2, @@ -67,7 +66,6 @@ def test_build_split_prompt_comprehensive(self): prompt = operation._build_split_prompt( goal="Understand security", codebase_path="/path/to/code", - focus_areas=["authentication", "authorization"], constraints="Focus on backend only", context="Legacy system", min_tasks=3, @@ -76,7 +74,6 @@ def test_build_split_prompt_comprehensive(self): assert "Understand security" in prompt assert "/path/to/code" in prompt - assert "authentication" in prompt assert "Focus on backend only" in prompt assert "Legacy system" in prompt @@ -273,19 +270,18 @@ def test_parse_ai_response_valid(self): assert tasks[1]["index"] == 1 @pytest.mark.asyncio - async def test_execute_with_focus_areas(self): - """Test execution with focus areas.""" + async def test_execute_with_constraints(self): + """Test execution with constraints.""" config = {"max_tasks": 5} inputs = { "goal": "Understand system", - "focus_areas": ["performance", "security"], - "constraints": "Backend only" + "constraints": "Backend only, focus on security" } operation = AISplitOperation(config, inputs) mock_response = { - "reasoning": "Focused on performance and security", + "reasoning": "Focused on backend security", "tasks": [ {"title": "Security", "query": "Security aspects", "type": "question", "priority": "high"} ] @@ -296,11 +292,9 @@ async def test_execute_with_focus_areas(self): result = await operation.execute() - # Verify focus areas were included in the call + # Verify constraints were included in the call call_args = mock_call.call_args[0][0] # Get prompt - assert "performance" in call_args - assert "security" in call_args - assert "Backend only" in call_args + assert "Backend only, focus on security" in call_args class TestAISplitIntegration: @@ -318,7 +312,7 @@ async def test_full_ai_split_execution(self): inputs = { "goal": "Understand authentication flow in the application", "codebase_path": "/path/to/code", - "focus_areas": ["security", "user management"] + "constraints": "Focus on security and user management" } operation = AISplitOperation(config, inputs) diff --git a/plugins/automation/tests/test_explore_agent.py b/plugins/automation/tests/test_explore_agent.py index 46410b1..358d3d7 100644 --- a/plugins/automation/tests/test_explore_agent.py +++ b/plugins/automation/tests/test_explore_agent.py @@ -143,19 +143,19 @@ def test_prepare_context_with_working_directories(self): assert "/dir2" in context assert "Working Directories" in context - def test_prepare_context_with_focus_areas(self): - """Test context preparation with focus areas""" - config = ExploreAgentConfig() + def test_prepare_context_with_search_paths(self): + """Test context preparation with search paths""" + config = ExploreAgentConfig( + search_paths=["/src/auth", "/src/db"] + ) agent = ExploreAgent(config) - context = agent.prepare_context( - focus_areas=["authentication", "database layer"] - ) + context = agent.prepare_context() assert context is not None - assert "authentication" in context - assert "database layer" in context - assert "Focus Areas" in context + assert "/src/auth" in context + assert "/src/db" in context + assert "Search Paths" in context def test_prepare_context_comprehensive(self): """Test context preparation with all parameters""" @@ -167,16 +167,13 @@ def test_prepare_context_comprehensive(self): agent = ExploreAgent(config) context = agent.prepare_context( - codebase_path="/work", - focus_areas=["api", "models"] + codebase_path="/work" ) assert context is not None assert "/work" in context assert "/work/current" in context assert "/work/src" in context - assert "api" in context - assert "models" in context @pytest.mark.asyncio async def test_explore(self): diff --git a/plugins/automation/tools/agent_tool.py b/plugins/automation/tools/agent_tool.py index 510cdfa..3ebe9ed 100644 --- a/plugins/automation/tools/agent_tool.py +++ b/plugins/automation/tools/agent_tool.py @@ -82,11 +82,6 @@ def input_schema(self) -> Dict[str, Any]: "description": "CLI type: claude, codex, or copilot", "enum": ["claude", "codex", "copilot"], }, - "focus_areas": { - "type": "array", - "items": {"type": "string"}, - "description": "Specific areas to focus on", - }, "working_directories": { "type": "array", "items": {"type": "string"}, @@ -158,7 +153,6 @@ async def execute_function( # Extract context (optional) context = parameters.get("context", {}) codebase_path = context.get("codebase_path") - focus_areas = context.get("focus_areas") cli_type_str = context.get("cli_type", "claude") model = context.get("model") session_id = context.get("session_id") @@ -183,7 +177,6 @@ async def execute_function( result = await agent.explore( question=prompt, codebase_path=codebase_path, - focus_areas=focus_areas, ) elif operation == AgentOperationType.FIND_IMPLEMENTATION: diff --git a/plugins/automation/workflows/examples/ai_exploration_workflow.yaml b/plugins/automation/workflows/examples/ai_exploration_workflow.yaml index 5ca2e6a..ef600b3 100644 --- a/plugins/automation/workflows/examples/ai_exploration_workflow.yaml +++ b/plugins/automation/workflows/examples/ai_exploration_workflow.yaml @@ -27,12 +27,6 @@ workflow: required: true description: Path to the codebase to explore - focus_areas: - type: array - required: false - default: [] - description: Optional areas to focus on (e.g., ["security", "performance"]) - constraints: type: string required: false @@ -64,7 +58,6 @@ workflow: inputs: goal: "{{ inputs.goal }}" codebase_path: "{{ inputs.codebase_path }}" - focus_areas: "{{ inputs.focus_areas }}" constraints: "{{ inputs.constraints }}" outputs: tasks: result.tasks diff --git a/plugins/automation/workflows/steps/agent_step.py b/plugins/automation/workflows/steps/agent_step.py index 005e382..69da6dd 100644 --- a/plugins/automation/workflows/steps/agent_step.py +++ b/plugins/automation/workflows/steps/agent_step.py @@ -227,7 +227,6 @@ async def _execute_explore_operation( ValueError: If operation not supported """ codebase_path = inputs.get("codebase_path") - focus_areas = inputs.get("focus_areas") if self.operation == "explore": question = inputs.get("question") @@ -236,7 +235,6 @@ async def _execute_explore_operation( return await agent.explore( question=question, codebase_path=codebase_path, - focus_areas=focus_areas, ) elif self.operation == "find_implementation": diff --git a/plugins/automation/workflows/steps/operations/ai_split.py b/plugins/automation/workflows/steps/operations/ai_split.py index c7241c6..bb1cfb5 100644 --- a/plugins/automation/workflows/steps/operations/ai_split.py +++ b/plugins/automation/workflows/steps/operations/ai_split.py @@ -30,7 +30,6 @@ class AISplitOperation(BaseOperation): Inputs: - goal: High-level exploration goal or question - codebase_path: Path to codebase being explored (optional, for context) - - focus_areas: Optional list of areas to focus on - constraints: Optional constraints (e.g., "focus on security", "prioritize performance") Returns: @@ -72,7 +71,6 @@ async def execute(self) -> Dict[str, Any]: """Execute AI-powered task splitting.""" goal = self.inputs.get("goal") codebase_path = self.inputs.get("codebase_path") - focus_areas = self.inputs.get("focus_areas", []) constraints = self.inputs.get("constraints") # Get config @@ -85,7 +83,6 @@ async def execute(self) -> Dict[str, Any]: prompt = self._build_split_prompt( goal=goal, codebase_path=codebase_path, - focus_areas=focus_areas, constraints=constraints, context=context, min_tasks=min_tasks, @@ -117,7 +114,6 @@ def _build_split_prompt( self, goal: str, codebase_path: Optional[str], - focus_areas: List[str], constraints: Optional[str], context: str, min_tasks: int, @@ -129,7 +125,6 @@ def _build_split_prompt( Args: goal: High-level exploration goal codebase_path: Path to codebase - focus_areas: Areas to focus on constraints: Additional constraints context: Extra context min_tasks: Minimum tasks to generate @@ -146,9 +141,6 @@ def _build_split_prompt( if codebase_path: prompt += f"\n**Codebase:** {codebase_path}" - if focus_areas: - prompt += f"\n**Focus Areas:** {', '.join(focus_areas)}" - if constraints: prompt += f"\n**Constraints:** {constraints}"