{"record":{"id":"989e3f78507fe95f","repo":"FoundationAgents/OpenManus","slug":"invalid-view-range-it-should-be-a-list-of-two-i","errorCode":null,"errorMessage":"Invalid `view_range`. It should be a list of two integers.","messagePattern":"Invalid `view_range`\\. It should be a list of two integers\\.","errorType":"exception","errorClass":"ToolError","httpStatus":null,"severity":"error","filePath":"app/tool/str_replace_editor.py","lineNumber":248,"sourceCode":"            )\n\n        return CLIResult(output=stdout, error=stderr)\n\n    async def _view_file(\n        self,\n        path: PathLike,\n        operator: FileOperator,\n        view_range: Optional[List[int]] = None,\n    ) -> CLIResult:\n        \"\"\"Display file content, optionally within a specified line range.\"\"\"\n        # Read file content\n        file_content = await operator.read_file(path)\n        init_line = 1\n\n        # Apply view range if specified\n        if view_range:\n            if len(view_range) != 2 or not all(isinstance(i, int) for i in view_range):\n                raise ToolError(\n                    \"Invalid `view_range`. It should be a list of two integers.\"\n                )\n\n            file_lines = file_content.split(\"\\n\")\n            n_lines_file = len(file_lines)\n            init_line, final_line = view_range\n\n            # Validate view range\n            if init_line < 1 or init_line > n_lines_file:\n                raise ToolError(\n                    f\"Invalid `view_range`: {view_range}. Its first element `{init_line}` should be \"\n                    f\"within the range of lines of the file: {[1, n_lines_file]}\"\n                )\n            if final_line > n_lines_file:\n                raise ToolError(\n                    f\"Invalid `view_range`: {view_range}. Its second element `{final_line}` should be \"\n                    f\"smaller than the number of lines in the file: `{n_lines_file}`\"\n                )","sourceCodeStart":230,"sourceCodeEnd":266,"githubUrl":"https://github.com/FoundationAgents/OpenManus/blob/52a13f2a57d8c7f6737eefb02ccf569594d44273/app/tool/str_replace_editor.py#L230-L266","documentation":"Error \"Invalid `view_range`. It should be a list of two integers.\" thrown in FoundationAgents/OpenManus.","triggerScenarios":"Raised when `view_range` is not a list of exactly two integers.","commonSituations":"See trigger scenarios.","solutions":["Pass `view_range` as a list of two integers, e.g. [1, 50]; use -1 as the second element for end of file."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"52a13f2a57d8c7f6737eefb02ccf569594d44273","analyzedAt":"2026-08-15T02:33:49.993Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}