FoundationAgents/OpenManus · error · ToolError
Parameter `new_str` is required for command: insert
Error message
Parameter `new_str` is required for command: insert
What it means
Error "Parameter `new_str` is required for command: insert" thrown in FoundationAgents/OpenManus.
Source
Thrown at app/tool/str_replace_editor.py:154
elif command == "create":
if file_text is None:
raise ToolError("Parameter `file_text` is required for command: create")
await operator.write_file(path, file_text)
self._file_history[path].append(file_text)
result = ToolResult(output=f"File created successfully at: {path}")
elif command == "str_replace":
if old_str is None:
raise ToolError(
"Parameter `old_str` is required for command: str_replace"
)
result = await self.str_replace(path, old_str, new_str, operator)
elif command == "insert":
if insert_line is None:
raise ToolError(
"Parameter `insert_line` is required for command: insert"
)
if new_str is None:
raise ToolError("Parameter `new_str` is required for command: insert")
result = await self.insert(path, insert_line, new_str, operator)
elif command == "undo_edit":
result = await self.undo_edit(path, operator)
else:
# This should be caught by type checking, but we include it for safety
raise ToolError(
f'Unrecognized command {command}. The allowed commands for the {self.name} tool are: {", ".join(get_args(Command))}'
)
return str(result)
async def validate_path(
self, command: str, path: Path, operator: FileOperator
) -> None:
"""Validate path and command combination based on execution environment."""
# Check if path is absolute
if not path.is_absolute():
raise ToolError(f"The path {path} is not an absolute path")View on GitHub (pinned to 52a13f2a57)
Solutions
- Pass the `new_str` parameter containing the text to insert when using command `insert`.
When it happens
Trigger: Raised when the `insert` command is called without the required `new_str` parameter.
Common situations: See trigger scenarios.
AI-assisted analysis of FoundationAgents/OpenManus@52a13f2a57 (2026-08-15).
Data as JSON: /api/errors/d1774931b0ad159c.
Report an issue: GitHub.