{"record":{"id":"19d6efa3a3b3ff17","repo":"Hmbown/CodeWhale","slug":"shell-manager-lock-poisoned","errorCode":null,"errorMessage":"shell manager lock poisoned","messagePattern":"shell manager lock poisoned","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/tui/src/tools/shell.rs","lineNumber":4022,"sourceCode":"    command: &str,\n    heavy_permit: Option<HeavyCommandPermit>,\n    working_dir: Option<String>,\n    timeout_ms: Option<u64>,\n    stdin_data: Option<&str>,\n    tty: bool,\n    policy_override: Option<ExecutionSandboxPolicy>,\n    extra_env: HashMap<String, String>,\n    direct_argv: bool,\n    timeout_bounds_ms: (u64, u64),\n) -> Result<ShellResult> {\n    let timeout_ms =\n        timeout_ms.map(|timeout| timeout.clamp(timeout_bounds_ms.0, timeout_bounds_ms.1));\n    let spawn_timeout_ms = timeout_ms.unwrap_or(timeout_bounds_ms.1);\n    let spawned = {\n        let mut manager = context\n            .shell_manager\n            .lock()\n            .map_err(|_| anyhow!(\"shell manager lock poisoned\"))?;\n        manager.clear_foreground_background_request();\n        let owner = shell_job_owner_from_context(context);\n        let lifecycle = shell_work_lifecycle_from_context(context);\n        manager.execute_with_options_env_for_owner_and_work(\n            command,\n            working_dir.as_deref(),\n            spawn_timeout_ms,\n            true,\n            stdin_data,\n            tty,\n            policy_override,\n            extra_env,\n            owner,\n            context.state_namespace.clone(),\n            lifecycle,\n            direct_argv.then_some(context.workspace.as_path()),\n            false,\n            timeout_bounds_ms,","sourceCodeStart":4004,"sourceCodeEnd":4040,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/0c42157ee52f9d55af2b506d71b46249910f77d3/crates/tui/src/tools/shell.rs#L4004-L4040","documentation":"Raised when locking the shell manager Mutex: .lock() returned a PoisonError because another thread panicked while holding the manager lock. The shell manager's internal state is now considered untrustworthy; this guard converts poisoning into an explicit error at the spawn site.","triggerScenarios":"Thrown at crates/tui/src/tools/shell.rs:4022 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check logs for the earlier panic that poisoned the lock — that root cause must be fixed","Restart the process to rebuild the shell manager state cleanly","If the underlying panic is transient (e.g. a killed child process), the retry after restart resolves it"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"0c42157ee52f9d55af2b506d71b46249910f77d3","analyzedAt":"2026-08-20T21:50:45.477Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}