{"record":{"id":"54e8f340dbfb38bf","repo":"FoundationAgents/OpenManus","slug":"unknown-flow-type-flow-type","errorCode":null,"errorMessage":"Unknown flow type: {flow_type}","messagePattern":"Unknown flow type: (.+?)","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"app/flow/flow_factory.py","lineNumber":28,"sourceCode":"    PLANNING = \"planning\"\n\n\nclass FlowFactory:\n    \"\"\"Factory for creating different types of flows with support for multiple agents\"\"\"\n\n    @staticmethod\n    def create_flow(\n        flow_type: FlowType,\n        agents: Union[BaseAgent, List[BaseAgent], Dict[str, BaseAgent]],\n        **kwargs,\n    ) -> BaseFlow:\n        flows = {\n            FlowType.PLANNING: PlanningFlow,\n        }\n\n        flow_class = flows.get(flow_type)\n        if not flow_class:\n            raise ValueError(f\"Unknown flow type: {flow_type}\")\n\n        return flow_class(agents, **kwargs)\n","sourceCodeStart":10,"sourceCodeEnd":31,"githubUrl":"https://github.com/FoundationAgents/OpenManus/blob/52a13f2a57d8c7f6737eefb02ccf569594d44273/app/flow/flow_factory.py#L10-L31","documentation":"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.","triggerScenarios":"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).","commonSituations":"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.","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"],"exampleFix":"# before\nflow = FlowFactory.create_flow(FlowType.FLOWFACTORY, agent)  # Unknown flow type\n\n# after\nflow = FlowFactory.create_flow(FlowType.PLANNING, agent)","handlingStrategy":"type-guard","validationCode":"from app.flow.flow_factory import FlowFactory\nfrom app.flow.flow_types import FlowType\n\ndef supported_flow(ft: FlowType) -> bool:\n    return ft == FlowType.PLANNING","typeGuard":"from typing import TypeGuard\nfrom app.flow.flow_types import FlowType\n\ndef is_supported_flow(value: object) -> TypeGuard[FlowType]:\n    return value is FlowType.PLANNING","tryCatchPattern":"try:\n    flow = FlowFactory.create_flow(flow_type, agents)\nexcept ValueError as e:\n    if \"Unknown flow type\" in str(e):\n        flow = FlowFactory.create_flow(FlowType.PLANNING, agents)  # explicit fallback\n    else:\n        raise","preventionTips":["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"],"tags":["flow","factory","enum","validation"],"backgroundTag":null,"analyzedSha":"52a13f2a57d8c7f6737eefb02ccf569594d44273","analyzedAt":"2026-08-15T02:33:49.993Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}