{"record":{"id":"18ff5833d12f6486","repo":"infiniflow/ragflow","slug":"not-supported-operator-operator","errorCode":null,"errorMessage":"Not supported operator: {operator}","messagePattern":"Not supported operator: (.+?)","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"agent/component/switch.py","lineNumber":135,"sourceCode":"            except Exception:\n                return True if input > value else False\n        elif operator == \"<\":\n            try:\n                return True if float(input) < float(value) else False\n            except Exception:\n                return True if input < value else False\n        elif operator == \"≥\":\n            try:\n                return True if float(input) >= float(value) else False\n            except Exception:\n                return True if input >= value else False\n        elif operator == \"≤\":\n            try:\n                return True if float(input) <= float(value) else False\n            except Exception:\n                return True if input <= value else False\n\n        raise ValueError(f\"Not supported operator: {operator}\")\n\n    def thoughts(self) -> str:\n        return \"I’m weighing a few options and will pick the next step shortly.\"\n","sourceCodeStart":117,"sourceCodeEnd":139,"githubUrl":"https://github.com/infiniflow/ragflow/blob/554fb1133ac3861732235ad9c377eb5e0a770665/agent/component/switch.py#L117-L139","documentation":"ValueError from Switch's condition evaluation (after the ≥/≤ branches shown). When none of the implemented operators match — contains, not contains, start with, end with, empty, not empty, =, ≠, >, <, ≥, ≤ — the fall-through raises 'Not supported operator'.","triggerScenarios":"A Switch condition whose operator is anything outside the SwitchParam.operators list: typos like 'starts with', '>=' instead of '≥', 'equals' instead of '=', or a localized label. Note Switch uses '≥'/'≤' Unicode forms, not ASCII '>='/'<='.","commonSituations":"Hand-editing canvas DSL with ASCII comparison operators; copying conditions from the Categorize or Loop components which use different operator vocabularies; templates authored against an older operator set.","solutions":["Pick the operator from the Switch UI dropdown so the canonical token is stored.","If writing DSL, restrict operators to: contains, not contains, start with, end with, empty, not empty, =, ≠, >, <, ≥, ≤.","Replace '>=' with '≥' and '<=' with '≤' in existing conditions."],"exampleFix":"// before\n{\"operator\": \">=\", \"value\": 10}\n\n// after\n{\"operator\": \"≥\", \"value\": 10}","handlingStrategy":"validation","validationCode":"SWITCH_OPS = {'contains', 'not contains', 'start with', 'end with', 'empty', 'not empty', '=', '≠', '>', '<', '≥', '≤'}\nfor cond in switch_param.conditions:\n    assert cond['operator'] in SWITCH_OPS, cond['operator']","typeGuard":"def is_switch_operator(op: str) -> bool:\n    return op in {'contains', 'not contains', 'start with', 'end with', 'empty', 'not empty', '=', '≠', '>', '<', '≥', '≤'}","tryCatchPattern":"try:\n    switch._invoke()\nexcept ValueError as e:\n    if 'Not supported operator' in str(e):\n        # replace with a supported operator token and re-run\n        ...","preventionTips":["Choose operators from the Switch dropdown; note ≥/≤ are Unicode, not ASCII >=/<=.","Do not reuse condition objects from Categorize/Loop components verbatim.","Lint canvas DSL operator vocabularies per component."],"tags":["switch","operator","configuration","agent-canvas"],"backgroundTag":null,"analyzedSha":"554fb1133ac3861732235ad9c377eb5e0a770665","analyzedAt":"2026-08-15T09:20:16.380Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}