Issue: Cleanup dead acp_enabled and lsp_enabled code from YAML workflow generator
1. Acceptance Criteria
- Remove unused extraction of
acp (Automated Context Purge / Agent Control Protocol) and lsp (Language Server Protocol) from the global section of YAML files within the praisonai wrapper's agents_generator.py.
- Prevent logging of dead variables.
- Maintain full parity and API usage rules defined by the
praisonaiagents core SDK.
2. Repo Inventory & Evidence
Target File: /src/praisonai/praisonai/agents_generator.py (Wrapper package)
Dead Code Snippet:
# Extract global config for CLI parity features
global_config = config.get('config', {})
acp_enabled = global_config.get('acp', False)
lsp_enabled = global_config.get('lsp', False)
Evidence of Dead Code:
acp_enabled and lsp_enabled were initialized but never passed to AgentTeam (praisonaiagents.agents.AgentTeam.__init__).
- The SDK
AgentTeam protocol previously consumed these, but as of the v4 architectural refinement, acp and lsp are no longer accepted.
- A
grep of agents_generator.py for acp_enabled or lsp_enabled confirms these local variables are only used in a debug self.logger.debug statement, consuming CPU cycles for no functional benefit.
3. Detailed Analysis
- Architecture: The YAML
agents_generator.py acts as a translating shim between CLI YAML declarations and the core SDK. Over time, config keys from legacy experimental features (acp, lsp, trust) were left dangling.
- Invariants Violated: DRY code and API Simplicity. The wrapper should only extract configuration variables that it intends to pass to the core SDK
AgentTeam or Agent interfaces.
4. Detailed Review (Quality vs Principles)
The lingering variables violated the DRY and Simple API principles. Extracting acp and lsp logic without utilizing them resulted in misleading debug logs (Global config - ACP: False, LSP: False) that obfuscate genuine debugging efforts.
5. Gap Analysis
- Core SDK: Clean (already removed
acp/lsp from AgentTeam signature).
- Wrapper:
agents_generator.py had a gap showing legacy extraction of acp and lsp from config['config'].
- Severity: Low. (Cosmetic/Code Style). No functional break, but it misleads maintainers.
6. Critical Review
- Risks: Passing unused arguments in legacy architectures often caused
TypeError: __init__() got an unexpected keyword argument. While acp_enabled wasn't passed, maintaining this code risks developers assuming acp is fully wired when defined via YAML docs.
- Safe by Default Mitigation: Eliminate strictly unused code paths.
7. Plan
- Implementation: Delete
acp_enabled and lsp_enabled assignments in agents_generator.py, keeping only memory = config.get('memory', False) extraction.
- Testing: Run standard suite and smoke test parser outputs to verify standard instantiation.
- Verification:
python -m pytest tests/unit/workflows & verify agent creation via YAML configurations without regression.
8. Proposal
Implement a direct structural cleanup in agents_generator.py to ensure only schema-supported features from the praisonaiagents core are parsed and surfaced. This aligns the Wrapper seamlessly with the underlying SDK protocols.
Issue: Cleanup dead
acp_enabledandlsp_enabledcode from YAML workflow generator1. Acceptance Criteria
acp(Automated Context Purge / Agent Control Protocol) andlsp(Language Server Protocol) from the global section of YAML files within thepraisonaiwrapper'sagents_generator.py.praisonaiagentscore SDK.2. Repo Inventory & Evidence
Target File:
/src/praisonai/praisonai/agents_generator.py(Wrapper package)Dead Code Snippet:
Evidence of Dead Code:
acp_enabledandlsp_enabledwere initialized but never passed toAgentTeam(praisonaiagents.agents.AgentTeam.__init__).AgentTeamprotocol previously consumed these, but as of the v4 architectural refinement,acpandlspare no longer accepted.grepofagents_generator.pyforacp_enabledorlsp_enabledconfirms these local variables are only used in a debugself.logger.debugstatement, consuming CPU cycles for no functional benefit.3. Detailed Analysis
agents_generator.pyacts as a translating shim between CLI YAML declarations and the core SDK. Over time, config keys from legacy experimental features (acp,lsp,trust) were left dangling.AgentTeamorAgentinterfaces.4. Detailed Review (Quality vs Principles)
The lingering variables violated the DRY and Simple API principles. Extracting
acpandlsplogic without utilizing them resulted in misleading debug logs (Global config - ACP: False, LSP: False) that obfuscate genuine debugging efforts.5. Gap Analysis
acp/lspfromAgentTeamsignature).agents_generator.pyhad a gap showing legacy extraction ofacpandlspfromconfig['config'].6. Critical Review
TypeError: __init__() got an unexpected keyword argument. Whileacp_enabledwasn't passed, maintaining this code risks developers assumingacpis fully wired when defined via YAML docs.7. Plan
acp_enabledandlsp_enabledassignments inagents_generator.py, keeping onlymemory = config.get('memory', False)extraction.python -m pytest tests/unit/workflows& verify agent creation via YAML configurations without regression.8. Proposal
Implement a direct structural cleanup in
agents_generator.pyto ensure only schema-supported features from thepraisonaiagentscore are parsed and surfaced. This aligns the Wrapper seamlessly with the underlying SDK protocols.