{"record":{"id":"12c2a75684ab29dc","repo":"iflytek/astron-agent","slug":"invalid-system-variable-value-value","errorCode":null,"errorMessage":"invalid system variable value {value}","messagePattern":"invalid system variable value (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"core/workflow/engine/entities/node_entities.py","lineNumber":76,"sourceCode":"\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\n        :return: Corresponding SystemVariable enum\n        :raises ValueError: If the value is not a valid system variable\n        \"\"\"\n        for system_variable in cls:\n            if system_variable.value == value:\n                return system_variable\n        raise ValueError(f\"invalid system variable value {value}\")\n\n\nclass NodeRunMetadataKey(Enum):\n    \"\"\"\n    Enumeration of metadata keys for node execution tracking.\n    \"\"\"\n\n    TOTAL_TOKENS = \"total_tokens\"\n    TOTAL_PRICE = \"total_price\"\n    CURRENCY = \"currency\"\n    TOOL_INFO = \"tool_info\"\n    ITERATION_ID = \"iteration_id\"\n    ITERATION_INDEX = \"iteration_index\"\n\n\n# Node types that continue execution on error without streaming\nCONTINUE_ON_ERROR_NOT_STREAM_NODE_TYPE = [\n    NodeType.DATABASE.value,","sourceCodeStart":58,"sourceCodeEnd":94,"githubUrl":"https://github.com/iflytek/astron-agent/blob/5e758547a83371a5a4b29dadf4ac03e8dd527635/core/workflow/engine/entities/node_entities.py#L58-L94","documentation":"SystemVariable.value_of maps a raw value to a SystemVariable enum member and raises ValueError('invalid system variable value {value}') when the value matches none of them. The library throws this to reject references to system variables (like workflow-level built-ins) that do not exist in this engine version, preventing undefined-variable resolution later during execution.","triggerScenarios":"A DSL or variable reference uses a system variable name that is not part of the SystemVariable enum — misspelled names, renamed system variables across versions, or variables referenced from another platform's DSL.","commonSituations":"Version migration where a system variable was renamed or removed; hand-written expressions referencing system variables with wrong casing; DSLs ported from a different workflow product.","solutions":["Correct the system variable name to one defined in the SystemVariable enum","Check the engine version docs for renamed/removed system variables and update the DSL","Upgrade the engine if the referenced variable exists only in newer releases","Enumerate cls members (or the docs) to see the exact accepted values before authoring references"],"exampleFix":"# before\n\"valueRef\": \"sys.workflow_conversation_id\"  # not a member\n# after\n\"valueRef\": \"sys.conversation_id\"","handlingStrategy":"validation","validationCode":"from core.workflow.engine.entities.node_entities import SystemVariable\nvalid = {sv.value for sv in SystemVariable}\nassert var_ref.split(\".\")[-1] in valid, f\"unknown system variable {var_ref}\"","typeGuard":"def is_known_system_variable(value) -> bool:\n    try:\n        SystemVariable.value_of(value)\n        return True\n    except ValueError:\n        return False","tryCatchPattern":"try:\n    sv = SystemVariable.value_of(raw)\nexcept ValueError as e:\n    log.warning(\"bad system variable reference: %s\", raw)\n    raise VariableResolutionError(str(e)) from e","preventionTips":["Reference system variables only from the engine version's documented list","When upgrading engines, grep DSLs for renamed system variables","Centralize system variable constants instead of inlining strings"],"tags":["enum","system-variable","workflow"],"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-19T12:17:13.211Z"}