From 6a45035e3fc2c6647fdd4dbdc6b0d0838410e28e Mon Sep 17 00:00:00 2001 From: catlog22 Date: Sat, 3 Jan 2026 17:34:55 +0800 Subject: [PATCH] fix: align test-fix-agent with code-developer task parsing MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add Command-to-Tool Mapping for pre_analysis commands - Add Execution Mode Selection for implementation_approach steps - command field exists → Execute CLI via Bash - no command → Agent direct execution with test_commands --- .claude/agents/test-fix-agent.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/.claude/agents/test-fix-agent.md b/.claude/agents/test-fix-agent.md index b4be5d0c..5f8b5e0e 100644 --- a/.claude/agents/test-fix-agent.md +++ b/.claude/agents/test-fix-agent.md @@ -59,6 +59,14 @@ When task JSON contains `flow_control` field, execute preparation and implementa 2. **Variable Substitution**: Use `[variable_name]` to reference previous outputs 3. **Error Handling**: Follow step-specific strategies (`skip_optional`, `fail`, `retry_once`) +**Command-to-Tool Mapping** (for pre_analysis commands): +``` +"Read(path)" → Read tool: Read(file_path=path) +"bash(command)" → Bash tool: Bash(command=command) +"Search(pattern,path)" → Grep tool: Grep(pattern=pattern, path=path) +"Glob(pattern)" → Glob tool: Glob(pattern=pattern) +``` + **Implementation Approach** (`flow_control.implementation_approach`): When task JSON contains implementation_approach array: 1. **Sequential Execution**: Process steps in order, respecting `depends_on` dependencies @@ -73,6 +81,12 @@ When task JSON contains implementation_approach array: - `command`: Optional CLI command (only when explicitly specified) - `depends_on`: Array of step numbers that must complete first - `output`: Variable name for this step's output +5. **Execution Mode Selection**: + - IF `command` field exists → Execute CLI command via Bash tool + - ELSE (no command) → Agent direct execution: + - Parse `modification_points` as files to modify + - Follow `logic_flow` for test-fix iteration + - Use test_commands from flow_control for test execution ### 1. Context Assessment & Test Discovery