BigPizzaV3/CodexPlusPlus · error
session export task failed
Error message
session export task failed: {error} What it means
This error wraps a JoinError from tokio::task::spawn_blocking in `export_session_file` (apps/codex-plus-launcher/src/main.rs:809). The blocking call to codex_plus_core::session_share::export_rollout panicked or was cancelled, so no export result exists. Inner export errors (file-not-found, serialization) come via the trailing `?`, not this message.
Solutions
- Log the JoinError panic payload to locate the panic in export_rollout
- Make export_rollout panic-free on malformed input
- Await the future fully; don't abort the export mid-flight
- Wait for pending exports before shutdown
Defensive patterns
Strategy: try-catch
Validate before calling
if session.session_id.trim().is_empty() { bail!("empty session id"); } Type guard
fn join_error_is_panic(err: &tokio::task::JoinError) -> bool { err.is_panic() } Try / catch
match spawn_blocking(move || export_rollout(&home, &sid)).await {
Ok(Ok(v)) => v,
Ok(Err(e)) => eprintln!("export error: {e}"),
Err(je) => eprintln!("export task panicked/cancelled: {je}"),
} Prevention
- Check the rollout file exists before exporting
- Await exports to completion; no mid-flight aborts
- Drain pending exports at shutdown
When it happens
Trigger: Calling `export_session_file(session)` when export_rollout panics (e.g. unwrap on session_id or rollout file parsing), when the future is dropped, or during runtime shutdown.
Common situations: Exporting a rollout file that is concurrently deleted or corrupted; exporting during app quit; a panicking code path in session_share on unusual session ids.
Related errors
- archived lookup task failed
- export markdown task failed
- Remote Control candidate check failed
- session import task failed
- thread usage history task failed
AI-assisted analysis of BigPizzaV3/CodexPlusPlus@b1ed92e5e4 (2026-09-19).
Data as JSON: /api/errors/33e14268bf51d983.
Report an issue: GitHub.
Appendix: source
Thrown at apps/codex-plus-launcher/src/main.rs:809
}
fn storage_adapter(&self) -> codex_plus_data::SQLiteStorageAdapter {
let allowed_db_paths = self.candidate_db_paths();
codex_plus_data::SQLiteStorageAdapter::new(
self.db_path.clone(),
codex_plus_data::BackupStore::new(self.backup_dir.clone()),
)
.with_allowed_db_paths(allowed_db_paths)
.with_codex_home(codex_plus_core::codex_sqlite::default_codex_home_dir())
}
async fn export_session_file(&self, session: SessionRef) -> anyhow::Result<Value> {
let home = codex_plus_core::codex_sqlite::default_codex_home_dir();
tokio::task::spawn_blocking(move || {
codex_plus_core::session_share::export_rollout(&home, &session.session_id)
})
.await
.map_err(|error| anyhow::anyhow!("session export task failed: {error}"))?
}
async fn import_session_file(&self, payload: Value) -> anyhow::Result<Value> {
let home = codex_plus_core::codex_sqlite::default_codex_home_dir();
tokio::task::spawn_blocking(move || {
codex_plus_core::session_share::import_rollout(&home, &payload)
})
.await
.map_err(|error| anyhow::anyhow!("session import task failed: {error}"))?
}
}
struct LauncherRuntimeService {
debug_port: Mutex<u16>,
websocket_url: Mutex<Option<String>>,
user_scripts: UserScriptManager,
}
View on GitHub (pinned to b1ed92e5e4)