{"record":{"id":"2e6013744e08cb79","repo":"tinyhumansai/openhuman","slug":"stash-index-too-large-index-raw","errorCode":null,"errorMessage":"stash index too large: {index_raw}","messagePattern":"stash index too large: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/openhuman/tools/impl/filesystem/git_operations.rs","lineNumber":412,"sourceCode":"    }\n\n    async fn git_stash(&self, cwd: &Path, args: serde_json::Value) -> anyhow::Result<ToolResult> {\n        let action = args\n            .get(\"action\")\n            .and_then(|v| v.as_str())\n            .unwrap_or(\"push\");\n\n        let output = match action {\n            \"push\" | \"save\" => {\n                self.run_git_command_in(cwd, &[\"stash\", \"push\", \"-m\", \"auto-stash\"])\n                    .await\n            }\n            \"pop\" => self.run_git_command_in(cwd, &[\"stash\", \"pop\"]).await,\n            \"list\" => self.run_git_command_in(cwd, &[\"stash\", \"list\"]).await,\n            \"drop\" => {\n                let index_raw = args.get(\"index\").and_then(|v| v.as_u64()).unwrap_or(0);\n                let index = i32::try_from(index_raw)\n                    .map_err(|_| anyhow::anyhow!(\"stash index too large: {index_raw}\"))?;\n                self.run_git_command_in(cwd, &[\"stash\", \"drop\", &format!(\"stash@{{{index}}}\")])\n                    .await\n            }\n            _ => anyhow::bail!(\"Unknown stash action: {action}. Use: push, pop, list, drop\"),\n        };\n\n        match output {\n            Ok(out) => Ok(ToolResult::success(out)),\n            Err(e) => Ok(ToolResult::error(format!(\"Stash {action} failed: {e}\"))),\n        }\n    }\n}\n\n#[async_trait]\nimpl Tool for GitOperationsTool {\n    fn name(&self) -> &str {\n        \"git_operations\"\n    }","sourceCodeStart":394,"sourceCodeEnd":430,"githubUrl":"https://github.com/tinyhumansai/openhuman/blob/749120085864ce16e0f273c7b86fac7740b39c5b/src/openhuman/tools/impl/filesystem/git_operations.rs#L394-L430","documentation":"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.","triggerScenarios":"Thrown at src/openhuman/tools/impl/filesystem/git_operations.rs:412 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Run stash list first and use a valid small index (0-based)","Keep indices within realistic stash counts"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"749120085864ce16e0f273c7b86fac7740b39c5b","analyzedAt":"2026-08-17T21:21:45.363Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}