{"record":{"id":"4ae9223053c63430","repo":"iflytek/astron-agent","slug":"invalid-node-type-value-value","errorCode":null,"errorMessage":"invalid node type value {value}","messagePattern":"invalid node type value (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"core/workflow/engine/entities/node_entities.py","lineNumber":51,"sourceCode":"    DATABASE = \"database\"\n    RPA = \"rpa\"\n    MCP = \"mcp\"\n    MEMORY_ADD = \"memory-add\"\n    MEMORY_SEARCH = \"memory-search\"\n\n    @classmethod\n    def value_of(cls, value: str) -> \"NodeType\":\n        \"\"\"\n        Get NodeType enum from string value.\n\n        :param value: Node type string value\n        :return: Corresponding NodeType enum\n        :raises ValueError: If the value is not a valid node type\n        \"\"\"\n        for node_type in cls:\n            if node_type.value == value:\n                return node_type\n        raise ValueError(f\"invalid node type value {value}\")\n\n\nclass SystemVariable(Enum):\n    \"\"\"\n    Enumeration of system variables available in the workflow.\n    \"\"\"\n\n    QUERY = \"query\"\n    FILES = \"files\"\n    CONVERSATION_ID = \"conversation_id\"\n    USER_ID = \"user_id\"\n\n    @classmethod\n    def value_of(cls, value: str) -> \"SystemVariable\":\n        \"\"\"\n        Get SystemVariable enum from string value.\n\n        :param value: System variable string value","sourceCodeStart":33,"sourceCodeEnd":69,"githubUrl":"https://github.com/iflytek/astron-agent/blob/5e758547a83371a5a4b29dadf4ac03e8dd527635/core/workflow/engine/entities/node_entities.py#L33-L69","documentation":"NodeType.value_of converts a raw string into a NodeType enum and raises ValueError('invalid node type value {value}') when no enum member matches. This guard exists so that DSL node dicts containing unknown node types fail fast instead of silently producing unhandled node behavior downstream.","triggerScenarios":"Parsing a DSL whose node has a 'type' value not present in the NodeType enum — custom/unknown types, typos, node types from a newer engine version loaded in an older one, or plugin node types not registered in the enum.","commonSituations":"Version skew: DSL exported from a newer release with new node types imported into an older engine; hand-edited type strings with wrong casing; third-party DSL generators emitting non-standard types.","solutions":["Fix the node's type value in the DSL to a NodeType member supported by this engine version","Upgrade the workflow engine to a version whose NodeType enum includes the node type used","Add any custom node types to the NodeType enum or register them via the extension mechanism before parsing","Lint the DSL against the engine's supported node types before import"],"exampleFix":"# before\n\"type\": \"llmNode\"  # unknown casing\n# after\n\"type\": \"llm\"","handlingStrategy":"validation","validationCode":"from core.workflow.engine.entities.node_entities import NodeType\nvalid = {t.value for t in NodeType}\nfor n in dsl[\"nodes\"]:\n    assert n.get(\"type\") in valid, f\"unknown node type {n.get('type')}\"","typeGuard":"def is_known_node_type(value) -> bool:\n    try:\n        NodeType.value_of(value)\n        return True\n    except ValueError:\n        return False","tryCatchPattern":"try:\n    nt = NodeType.value_of(raw_type)\nexcept ValueError as e:\n    log.error(\"unsupported node type in DSL: %s\", raw_type)\n    raise DslImportError(str(e)) from e","preventionTips":["Keep engine and console versions aligned so node type enums match","Validate DSL node types against the enum before import","Avoid editing node 'type' fields by hand; use editor templates"],"tags":["enum","workflow","node","validation"],"backgroundTag":"invalid-enum-value","analyzedSha":"5e758547a83371a5a4b29dadf4ac03e8dd527635","analyzedAt":"2026-09-12T08:03:51.356Z","contentChangedAt":"2026-09-12T08:03:51.356Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}