{"record":{"id":"2ef1af4eea945f12","repo":"BigPizzaV3/CodexPlusPlus","slug":"thread-usage-history-task-failed-error","errorCode":null,"errorMessage":"thread usage history task failed: {error}","messagePattern":"thread usage history task failed: (.+?)","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"apps/codex-plus-launcher/src/main.rs","lineNumber":655,"sourceCode":"        tokio::task::spawn_blocking(move || adapter.undo(&undo_token))\n            .await\n            .map_err(|error| anyhow::anyhow!(\"undo task failed: {error}\"))\n    }\n\n    async fn export_markdown(&self, session: SessionRef) -> anyhow::Result<ExportResult> {\n        let db_paths = self.candidate_db_paths();\n        tokio::task::spawn_blocking(move || {\n            codex_plus_data::export_markdown_from_paths(db_paths, &session)\n        })\n        .await\n        .map_err(|error| anyhow::anyhow!(\"export markdown task failed: {error}\"))\n    }\n\n    async fn thread_usage_history(&self, session: SessionRef) -> anyhow::Result<Value> {\n        let adapter = self.storage_adapter();\n        tokio::task::spawn_blocking(move || adapter.codex_thread_usage_history(&session))\n            .await\n            .map_err(|error| anyhow::anyhow!(\"thread usage history task failed: {error}\"))\n    }\n\n    async fn find_archived_thread_by_title(\n        &self,\n        title: String,\n    ) -> anyhow::Result<Option<SessionRef>> {\n        let adapter = self.storage_adapter();\n        tokio::task::spawn_blocking(move || adapter.find_archived_thread_by_title(&title))\n            .await\n            .map_err(|error| anyhow::anyhow!(\"archived lookup task failed: {error}\"))\n    }\n\n    async fn recover_remote_control_session(&self, thread_id: String) -> anyhow::Result<Value> {\n        let settings = codex_plus_core::settings::SettingsStore::default()\n            .load()\n            .unwrap_or_default();\n        let profile = settings.active_relay_profile();\n        if !settings.relay_profiles_enabled","sourceCodeStart":637,"sourceCodeEnd":673,"githubUrl":"https://github.com/BigPizzaV3/CodexPlusPlus/blob/f2074595a281bc057525c748175c8eb9805b0673/apps/codex-plus-launcher/src/main.rs#L637-L673","documentation":"Wrapped failure thrown by LauncherDataService::thread_usage_history when the spawn_blocking task around adapter.codex_thread_usage_history fails as a task (JoinError), reported as \"thread usage history task failed: {error}\". Means the blocking wrapper died (panic/cancel), not that history lookup returned a domain error.","triggerScenarios":"Thrown at apps/codex-plus-launcher/src/main.rs:655 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["查看 usage history 任务的 panic 堆栈","确认会话引用与数据库路径有效","重试查询","检查 adapter 内对空结果集的 unwrap 处理"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"f2074595a281bc057525c748175c8eb9805b0673","analyzedAt":"2026-08-23T12:52:24.489Z","contentChangedAt":"2026-08-23T12:52:24.489Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}