Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions plugins/automation/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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?"
)
```

Expand Down
10 changes: 0 additions & 10 deletions plugins/automation/agents/explore_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,15 +180,13 @@ def _get_exploration_instructions(self) -> str:
def prepare_context(
self,
codebase_path: Optional[str] = None,
focus_areas: Optional[List[str]] = None,
**kwargs
) -> Optional[str]:
"""
Prepare context for codebase exploration.

Args:
codebase_path: Path to the codebase root
focus_areas: Specific areas or components to focus on
**kwargs: Additional context parameters

Returns:
Expand All @@ -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])
Expand All @@ -228,23 +221,20 @@ 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.

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
"""
return await self.invoke(
prompt=question,
codebase_path=codebase_path,
focus_areas=focus_areas,
)

async def find_implementation(
Expand Down
5 changes: 0 additions & 5 deletions plugins/automation/tests/test_agent_tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
}
})
Expand All @@ -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"""
Expand Down
20 changes: 7 additions & 13 deletions plugins/automation/tests/test_ai_split_operation.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
Expand All @@ -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

Expand Down Expand Up @@ -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"}
]
Expand All @@ -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:
Expand All @@ -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)
Expand Down
23 changes: 10 additions & 13 deletions plugins/automation/tests/test_explore_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"""
Expand All @@ -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):
Expand Down
7 changes: 0 additions & 7 deletions plugins/automation/tools/agent_tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"},
Expand Down Expand Up @@ -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")
Expand All @@ -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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions plugins/automation/workflows/steps/agent_step.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -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":
Expand Down
8 changes: 0 additions & 8 deletions plugins/automation/workflows/steps/operations/ai_split.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand All @@ -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,
Expand Down Expand Up @@ -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,
Expand All @@ -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
Expand All @@ -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}"

Expand Down
Loading