IAV-593/refactor(agent): Remove hierarchical dependencies and reorganize error codes
🎯 Overview
This MR simplifies agent activation/deactivation logic by removing parent-child dependencies and reorganizes the error code structure with expanded ranges for better maintainability.
🔧 Changes Made
1. Agent Activation/Deactivation Independence
Before: Sub-agents depended on parent agent status (couldn't activate if parent inactive, cascading deactivation)
After: All agents operate independently with no parent-child restrictions
Files Modified:
-
AgentServiceImpl.java-
activateAgent(): Removed parent status validation -
deactivateAgent(): Removed cascade deactivation logic
-
2. Error Code Reorganization
Problem: Narrow error code ranges required frequent refactoring
Solution: Expanded ranges with 20-60 code buffers per category
Files Modified:
-
BusinessErrorCode.java: All codes renumbered with expanded ranges -
BusinessErrorCodeTest.java: Updated range validation
New Range Structure:
- AGENT: 001-099 (was 001-059)
- TONE & STYLE: 100-119 (was 060-069)
- LANGUAGE: 140-169 (was 080-099)
- INSTRUCTIONS: 170-249 (was 100-189)
- FILE: 270-299 (was 220-239)
- CONVERSATION: 530-569 (was 440-459)
- MESSAGE: 570-599 (was 460-479)
- INTEGRATION: 640-699 (was 520-539)
3. Error Code Consolidation
Removed:
AGENT_MAIN_ACTIVATE_FAILEDAGENT_MAIN_DEACTIVATE_FAILEDAGENT_SUB_ACTIVATE_NOT_ALLOWED
Using Instead:
-
AGENT_ACTIVATE_FAILED(009) -
AGENT_DEACTIVATE_FAILED(010)
📊 Impact Analysis
Breaking Changes
Behavioral Changes
Non-Breaking
✅ Testing
-
All unit tests passing -
Error code range validation passing -
No duplicate codes -
Agent independence verified
🔗 Related Issues
Closes IAV-593