{"record":{"id":"3ea44e839a2c7301","repo":"FoundationAgents/OpenManus","slug":"parameter-old-str-is-required-for-command-str-r","errorCode":null,"errorMessage":"Parameter `old_str` is required for command: str_replace","messagePattern":"Parameter `old_str` is required for command: str_replace","errorType":"exception","errorClass":"ToolError","httpStatus":null,"severity":"error","filePath":"app/tool/str_replace_editor.py","lineNumber":144,"sourceCode":"        \"\"\"Execute a file operation command.\"\"\"\n        # Get the appropriate file operator\n        operator = self._get_operator()\n\n        # Validate path and command combination\n        await self.validate_path(command, Path(path), operator)\n\n        # Execute the appropriate command\n        if command == \"view\":\n            result = await self.view(path, view_range, operator)\n        elif command == \"create\":\n            if file_text is None:\n                raise ToolError(\"Parameter `file_text` is required for command: create\")\n            await operator.write_file(path, file_text)\n            self._file_history[path].append(file_text)\n            result = ToolResult(output=f\"File created successfully at: {path}\")\n        elif command == \"str_replace\":\n            if old_str is None:\n                raise ToolError(\n                    \"Parameter `old_str` is required for command: str_replace\"\n                )\n            result = await self.str_replace(path, old_str, new_str, operator)\n        elif command == \"insert\":\n            if insert_line is None:\n                raise ToolError(\n                    \"Parameter `insert_line` is required for command: insert\"\n                )\n            if new_str is None:\n                raise ToolError(\"Parameter `new_str` is required for command: insert\")\n            result = await self.insert(path, insert_line, new_str, operator)\n        elif command == \"undo_edit\":\n            result = await self.undo_edit(path, operator)\n        else:\n            # This should be caught by type checking, but we include it for safety\n            raise ToolError(\n                f'Unrecognized command {command}. The allowed commands for the {self.name} tool are: {\", \".join(get_args(Command))}'\n            )","sourceCodeStart":126,"sourceCodeEnd":162,"githubUrl":"https://github.com/FoundationAgents/OpenManus/blob/52a13f2a57d8c7f6737eefb02ccf569594d44273/app/tool/str_replace_editor.py#L126-L162","documentation":"Error \"Parameter `old_str` is required for command: str_replace\" thrown in FoundationAgents/OpenManus.","triggerScenarios":"Raised when the `str_replace` command is called without the required `old_str` parameter.","commonSituations":"See trigger scenarios.","solutions":["Pass the `old_str` parameter containing the exact text to replace when using command `str_replace`."],"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-15T17:31:12.345Z"}