←
PLOW-9
Created: 2025-12-21
•
Updated: 2025-12-21
Relationships
Loading...
Attachments
Loading...
Comments (1)
agent
·
2025-12-21
## Fix Summary
Refactored run_qa_agent() in workflow_v2.py to use label-based dynamic selection, similar to how triage was refactored in PLOW-7.
### Changes Made
**1. Added new selector fields to StepConfig (config/loader.py:160-169)**
- model_selector: Maps context values to model config keys (e.g., web → powerful)
- mcp_selector: Maps context values to MCP server lists (e.g., web → [chrome-devtools])
**2. Added new methods to StepConfig (config/loader.py:271-367)**
- resolve_model_key(): Resolves model config key from context
- get_model_id(): Resolves actual Claude API model ID
- resolve_mcp_servers(): Resolves MCP servers from context
- resolve_all(): Resolves all dynamic values in one call
**3. Created unified qa step (config/agents.yml:191-219)**
- agent_selector: web→trckr-web-qa, cli→trckr-cli-qa, default→code-verification-qa
- template_selector: web→qa-web.j2, cli→qa-cli.j2, default→qa-verification.j2
- model_selector: web→powerful (opus), cli/default→fast (sonnet)
- mcp_selector: web→[chrome-devtools]
**4. Refactored run_qa_agent() (workflow_v2.py:958-1018)**
- Added _determine_qa_type() helper to map labels to qa_type
- Simplified run_qa_agent() to use unified qa step with qa_type context
- Reduced from ~105 lines to ~60 lines (including helper)
**5. Updated _resolve_selector() and _build_options()**
- Now passes resolved selectors for dynamic model/MCP selection
### Test Results
- 436 tests passing
- Added 30 new tests for new functionality
- 73% code coverage maintained