tinyhumansai/openhuman · error
edit[{i}]: missing `new_string`
Error message
edit[{i}]: missing `new_string` What it means
Guard while parsing apply_patch edits: edit[{i}] has path and old_string but no string `new_string`, so the replacement text is unknown. An empty string is valid (deletion) but must be present as a string.
Source
Thrown at src/openhuman/tools/impl/filesystem/apply_patch.rs:144
}
let path_policy = super::security_for_tool_context(&self.security, context, "apply_patch");
// Parse + group edits by file.
let mut parsed: Vec<ParsedEdit> = Vec::with_capacity(edits.len());
for (i, raw) in edits.iter().enumerate() {
let path = raw
.get("path")
.and_then(|v| v.as_str())
.ok_or_else(|| anyhow::anyhow!("edit[{i}]: missing `path`"))?;
let old_string = raw
.get("old_string")
.and_then(|v| v.as_str())
.ok_or_else(|| anyhow::anyhow!("edit[{i}]: missing `old_string`"))?;
let new_string = raw
.get("new_string")
.and_then(|v| v.as_str())
.ok_or_else(|| anyhow::anyhow!("edit[{i}]: missing `new_string`"))?;
let replace_all = raw
.get("replace_all")
.and_then(|v| v.as_bool())
.unwrap_or(false);
if old_string.is_empty() {
return Ok(ToolResult::error(format!(
"edit[{i}]: `old_string` must not be empty"
)));
}
if !path_policy.is_path_string_allowed(path) {
return Ok(ToolResult::error(format!(
"edit[{i}]: path not allowed: {path}"
)));
}
parsed.push(ParsedEdit {
index: i,
path: path.to_string(),View on GitHub (pinned to 7491200858)
Solutions
- Add `new_string` to edit[{i}] with the replacement text
- Use an explicit empty string for deletions
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at src/openhuman/tools/impl/filesystem/apply_patch.rs:144 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of tinyhumansai/openhuman@7491200858 (2026-08-17).
Data as JSON: /api/errors/49f76ce3e73aa4e3.
Report an issue: GitHub.