tinyhumansai/openhuman · error

Commit message cannot be empty

Error message

Commit message cannot be empty

What it means

git_commit sanitized the submitted message by trimming each line and dropping empty ones, and the result was the empty string — the commit would have no message text at all, so it is refused before git runs.

Source

Thrown at src/openhuman/tools/impl/filesystem/git_operations.rs:327

        }
    }

    async fn git_commit(&self, cwd: &Path, args: serde_json::Value) -> anyhow::Result<ToolResult> {
        let message = args
            .get("message")
            .and_then(|v| v.as_str())
            .ok_or_else(|| anyhow::anyhow!("Missing 'message' parameter"))?;

        // Sanitize commit message
        let sanitized = message
            .lines()
            .map(|l| l.trim())
            .filter(|l| !l.is_empty())
            .collect::<Vec<_>>()
            .join("\n");

        if sanitized.is_empty() {
            anyhow::bail!("Commit message cannot be empty");
        }

        // Limit message length
        let message = Self::truncate_commit_message(&sanitized);

        let output = self
            .run_git_command_in(cwd, &["commit", "-m", &message])
            .await;

        match output {
            Ok(_) => Ok(ToolResult::success(format!("Committed: {message}"))),
            Err(e) => Ok(ToolResult::error(format!("Commit failed: {e}"))),
        }
    }

    async fn git_add(&self, cwd: &Path, args: serde_json::Value) -> anyhow::Result<ToolResult> {
        let paths = args
            .get("paths")

View on GitHub (pinned to 7491200858)

Solutions

  1. Provide a message containing at least one non-whitespace line
  2. Check that the message field is a JSON string and not accidentally whitespace-only
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at src/openhuman/tools/impl/filesystem/git_operations.rs:327 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/5e32d7b90924ccdf. Report an issue: GitHub.