{"record":{"id":"5976e664aa72682a","repo":"FoundationAgents/MetaGPT","slug":"not-implement-node-value","errorCode":null,"errorMessage":"Not implement: {node.value}","messagePattern":"Not implement: (.+?)","errorType":"exception","errorClass":"NotImplementedError","httpStatus":null,"severity":"warning","filePath":"metagpt/repo_parser.py","lineNumber":604,"sourceCode":"    def _parse_expr(node) -> List:\n        \"\"\"\n        Parses an expression Abstract Syntax Tree (AST) node.\n\n        Args:\n            node: The AST node representing an expression.\n\n        Returns:\n            List: A list containing the parsed information from the expression node.\n        \"\"\"\n        funcs = {\n            any_to_str(ast.Constant): lambda x: [any_to_str(x.value), RepoParser._parse_variable(x.value)],\n            any_to_str(ast.Call): lambda x: [any_to_str(x.value), RepoParser._parse_variable(x.value.func)],\n            any_to_str(ast.Tuple): lambda x: [any_to_str(x.value), RepoParser._parse_variable(x.value)],\n        }\n        func = funcs.get(any_to_str(node.value))\n        if func:\n            return func(node)\n        raise NotImplementedError(f\"Not implement: {node.value}\")\n\n    @staticmethod\n    def _parse_name(n):\n        \"\"\"\n        Gets the 'name' value of an Abstract Syntax Tree (AST) node.\n\n        Args:\n            n: The AST node.\n\n        Returns:\n            The 'name' value of the AST node.\n        \"\"\"\n        if n.asname:\n            return f\"{n.name} as {n.asname}\"\n        return n.name\n\n    @staticmethod\n    def _parse_if(n):","sourceCodeStart":586,"sourceCodeEnd":622,"githubUrl":"https://github.com/FoundationAgents/MetaGPT/blob/11cdf466d042aece04fc6cfd13b28e1a70341b1f/metagpt/repo_parser.py#L586-L622","documentation":"RepoParser._parse_expr handles only three AST expression shapes: ast.Constant, ast.Call, and ast.Tuple. Any other node.value type (e.g. BinOp, Name at value position, ListComp) hits the explicit NotImplementedError. This is a parser coverage limit, not a user config error.","triggerScenarios":"RepoParser walks module-level or class-level assignments whose RHS is an unsupported expression, e.g. SIZE = 1024 * 1024 (ast.BinOp) or NAMES = [n for n in x] (ast.ListComp), while extracting code blocks.","commonSituations":"Parsing dependencies of arbitrary Python projects during generate_dependencies / class-view generation; expression-heavy config modules; codebases using comprehensions or arithmetic at module level.","solutions":["Wrap or limit parsing to the files you control, excluding the file with the unsupported expression","Extend the funcs dict in _parse_expr with a lambda for the offending node type returning a list","Report/upgrade MetaGPT — newer parsers may cover more expression types"],"exampleFix":"// before\nMAX = 1024 * 1024  # ast.BinOp -> NotImplementedError when parsed\n\n// after\nMAX = 1048576  # ast.Constant is supported","handlingStrategy":"fallback","validationCode":null,"typeGuard":"import ast\n\nSUPPORTED_EXPRS = (ast.Constant, ast.Call, ast.Tuple)\n\ndef expr_is_supported(node) -> bool:\n    return isinstance(getattr(node, \"value\", None), SUPPORTED_EXPRS)","tryCatchPattern":"try:\n    parsed = RepoParser._parse_expr(node)\nexcept NotImplementedError:\n    parsed = [str(type(node.value).__name__), None]  # degrade gracefully, keep scanning","preventionTips":["Prefer simple literal/call/tuple module-level expressions in parsed codebases","Wrap repo parsing loops in try/except NotImplementedError and skip the file","Track MetaGPT updates that widen expression coverage"],"tags":["ast","parser","repo-analysis"],"backgroundTag":null,"analyzedSha":"11cdf466d042aece04fc6cfd13b28e1a70341b1f","analyzedAt":"2026-08-14T23:20:02.994Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}