tinyhumansai/openhuman · error
Failed to read {}: {e}
Error message
Failed to read {}: {e} What it means
The helper read_or_empty maps tokio::fs::read_to_string failures (other than not-found, which yields "") into this error — e.g. permission denied or an I/O error on MEMORY.md/SKILL.md. It means the existing file exists but could not be read, aborting the read-modify-write.
Source
Thrown at src/openhuman/tools/impl/filesystem/update_memory_md.rs:404
"[update_memory_md] replaced section '{}' in {file} ({} bytes written)",
section_title,
new_file_content.len()
);
Ok(ToolResult::success(format!(
"Section '{}' updated in {file} ({} bytes).",
section_title,
new_file_content.len()
)))
}
}
/// Read file to string, returning an empty string when the file does not exist.
async fn read_or_empty(path: &std::path::Path) -> anyhow::Result<String> {
match tokio::fs::read_to_string(path).await {
Ok(s) => Ok(s),
Err(e) if e.kind() == std::io::ErrorKind::NotFound => Ok(String::new()),
Err(e) => Err(anyhow::anyhow!("Failed to read {}: {e}", path.display())),
}
}
#[cfg(test)]
mod tests {
use super::*;
fn make_tool(dir: &std::path::Path) -> UpdateMemoryMdTool {
UpdateMemoryMdTool::new(dir.to_path_buf())
}
#[tokio::test]
async fn append_creates_file_if_missing() {
let dir = tempfile::tempdir().unwrap();
let tool = make_tool(dir.path());
let result = tool
.execute(json!({
"file": "MEMORY.md",View on GitHub (pinned to 7491200858)
Solutions
- Check file permissions on the target MEMORY.md/SKILL.md and repair them
- Rule out disk/FS errors; then retry the update
Defensive patterns
Strategy: retry
When it happens
Trigger: Thrown at src/openhuman/tools/impl/filesystem/update_memory_md.rs:404 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/de0ddaf821d215c1.
Report an issue: GitHub.