Inert `single_agent` parameter in auto.py generators: documented but never read (dead/unimplemented surface)
Summary
The single_agent constructor parameter on the wrapper's YAML scaffolding generators (AutoGenerator and WorkflowAutoGenerator in src/praisonai/praisonai/auto.py) is accepted, documented, and stored — but never read on any generation path. The paired SingleAgentStructure Pydantic model is registered but never drives generation. This is dead/unimplemented surface that can silently mislead users (setting single_agent=True still produces a team).
Current behaviour
# src/praisonai/praisonai/auto.py
class AutoGenerator:
def __init__(self, ..., single_agent: bool = False, ...):
# docstring: "single_agent: If True, generate a single agent instead of a team"
self.single_agent = single_agent # stored, then never used
class WorkflowAutoGenerator:
def __init__(self, ..., single_agent: bool = False, ...):
# docstring: "single_agent: If True, generate a single agent workflow"
self.single_agent = single_agent # stored, then never usedVerification (grep across src/praisonai/praisonai/):
self.single_agentis only ever assigned (self.single_agent = single_agent); there is no read anywhere.- Generation always builds
TeamStructure/WorkflowStructure;SingleAgentStructure(defined atauto.py:987, registered in the model factory map, and exported atauto.py:1587) is never used to drive a generation path.
So the documented "generate a single agent" behaviour does not exist — the flag is inert.
Why it matters
User confusion / correctness of the public surface: the parameter is documented in the constructor docstrings, so a user who passes single_agent=True reasonably expects single-agent output and silently gets a team. It is also unnecessary maintenance surface (an exported model and factory entry with no consumer). No import or hot-path cost.
Category
Dead code
Capability preserved
- All existing team/workflow YAML generation is unchanged.
- No change to any CLI verb, YAML schema, or the
run/arunPython entry points. - No public symbol is removed in the minimal (deprecate-only) option.
Proposed approach
Two conservative, non-breaking options — pick one:
- Deprecate the inert surface (safest, no behaviour change): keep the
single_agentparameter for signature compatibility, but emit aDeprecationWarningwhen it is passed truthy, documenting that single-agent generation is not implemented; stop advertising the behaviour in the docstrings; drop the unusedSingleAgentStructureexport from the factory map (retain the class if any test imports it). - Implement it (feature completion): wire
single_agent=Trueto generate a single-agentSingleAgentStructureconfig end-to-end, with a real agentic test. This adds behaviour, so only if there is a live consumer/demand — otherwise prefer option 1 to keep the wrapper lightweight.
Do not simply delete the constructor parameter without a deprecation cycle (it is part of the public constructor signature).
Resolution sketch
# After (option 1 — honest surface, no silent no-op)
def __init__(self, ..., single_agent: bool = False, ...):
if single_agent:
warnings.warn(
"single_agent generation is not implemented; a team structure "
"is generated instead. This parameter is deprecated.",
DeprecationWarning, stacklevel=2,
)
self.single_agent = single_agentLayer placement
- Primary layer: wrapper
- Touches core/tools/plugins (optional): none
- 3-way surface (CLI + YAML + Python): preserved yes (no surface added/removed under option 1)
Severity
Low — no runtime cost; fixes a silently-inert documented parameter (correctness/clarity of the public API).
Validation
Traced with grep: self.single_agent has assignments only and no reads; SingleAgentStructure has no generation-driving consumer. Not intentional robustness. Option 1 changes no existing behaviour (only warns on a flag that already did nothing).
Keep unchanged
- Team/workflow structure generation, prompt building, tool allowlist enforcement, atomic writes, and merge logic in
auto.py. agents_generator.pyYAML normalisation / CLI-merge / adapter delegation.- The
run/arunentry points and thepraisonaiCLI generate paths.
Source: MervinPraison/PraisonAI