FoundationAgents/OpenManus · error · ValueError
Unknown flow type: {flow_type}
Error message
Unknown flow type: {flow_type} What it means
Raised by FlowFactory.create_flow() when flow_type is not in its registry. This version registers only FlowType.PLANNING, so any other enum value (or a raw string that does not match) is unsupported. It is a fail-fast guard against typos and unavailable flow implementations.
Source
Thrown at app/flow/flow_factory.py:28
PLANNING = "planning"
class FlowFactory:
"""Factory for creating different types of flows with support for multiple agents"""
@staticmethod
def create_flow(
flow_type: FlowType,
agents: Union[BaseAgent, List[BaseAgent], Dict[str, BaseAgent]],
**kwargs,
) -> BaseFlow:
flows = {
FlowType.PLANNING: PlanningFlow,
}
flow_class = flows.get(flow_type)
if not flow_class:
raise ValueError(f"Unknown flow type: {flow_type}")
return flow_class(agents, **kwargs)
View on GitHub (pinned to 52a13f2a57)
Solutions
- Use FlowType.PLANNING, the only registered value: flow = FlowFactory.create_flow(FlowType.PLANNING, agents)
- If you need other flows, register them in the flows dict in app/flow/flow_factory.py or instantiate PlanningFlow directly
- Pass the enum member, not a string, to avoid lookup misses
Example fix
# before flow = FlowFactory.create_flow(FlowType.FLOWFACTORY, agent) # Unknown flow type # after flow = FlowFactory.create_flow(FlowType.PLANNING, agent)
Defensive patterns
Strategy: type-guard
Validate before calling
from app.flow.flow_factory import FlowFactory
from app.flow.flow_types import FlowType
def supported_flow(ft: FlowType) -> bool:
return ft == FlowType.PLANNING Type guard
from typing import TypeGuard
from app.flow.flow_types import FlowType
def is_supported_flow(value: object) -> TypeGuard[FlowType]:
return value is FlowType.PLANNING Try / catch
try:
flow = FlowFactory.create_flow(flow_type, agents)
except ValueError as e:
if "Unknown flow type" in str(e):
flow = FlowFactory.create_flow(FlowType.PLANNING, agents) # explicit fallback
else:
raise Prevention
- Restrict user/config input to the enum values registered in FlowFactory
- Pass FlowType enum members, never raw strings
- When upgrading the framework, re-check which flows are registered before using them
When it happens
Trigger: FlowFactory.create_flow(FlowType.FLOWFACTORY, agents) or any flow_type other than FlowType.PLANNING; passing flow_type as a string like "planning" when a FlowType enum member is expected (dict lookup by string can also miss).
Common situations: Following docs/tutorials from a fuller version of the framework that has flowfactory/planning variants; copy-pasting code that references flows removed in this build; enum/string mismatch at the call boundary.
Related errors
- Unsupported connection type: {self.connection_type}
- No primary agent available
- Invalid tool_choice: {tool_choice}
- Server URL is required for SSE connection
- Command is required for stdio connection
AI-assisted analysis of FoundationAgents/OpenManus@52a13f2a57 (2026-08-15).
Data as JSON: /api/errors/54e8f340dbfb38bf.
Report an issue: GitHub.