tinyhumansai/openhuman · error

stash index too large: {index_raw}

Error message

stash index too large: {index_raw}

What it means

Git stash guard: the 'index' argument for a stash drop/apply action parsed as a number but exceeds usize bounds, so it cannot address any stash entry. The stash action is refused before git runs.

Source

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

    }

    async fn git_stash(&self, cwd: &Path, args: serde_json::Value) -> anyhow::Result<ToolResult> {
        let action = args
            .get("action")
            .and_then(|v| v.as_str())
            .unwrap_or("push");

        let output = match action {
            "push" | "save" => {
                self.run_git_command_in(cwd, &["stash", "push", "-m", "auto-stash"])
                    .await
            }
            "pop" => self.run_git_command_in(cwd, &["stash", "pop"]).await,
            "list" => self.run_git_command_in(cwd, &["stash", "list"]).await,
            "drop" => {
                let index_raw = args.get("index").and_then(|v| v.as_u64()).unwrap_or(0);
                let index = i32::try_from(index_raw)
                    .map_err(|_| anyhow::anyhow!("stash index too large: {index_raw}"))?;
                self.run_git_command_in(cwd, &["stash", "drop", &format!("stash@{{{index}}}")])
                    .await
            }
            _ => anyhow::bail!("Unknown stash action: {action}. Use: push, pop, list, drop"),
        };

        match output {
            Ok(out) => Ok(ToolResult::success(out)),
            Err(e) => Ok(ToolResult::error(format!("Stash {action} failed: {e}"))),
        }
    }
}

#[async_trait]
impl Tool for GitOperationsTool {
    fn name(&self) -> &str {
        "git_operations"
    }

View on GitHub (pinned to 7491200858)

Solutions

  1. Run stash list first and use a valid small index (0-based)
  2. Keep indices within realistic stash counts
Defensive patterns

Strategy: validation

When it happens

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