BigPizzaV3/CodexPlusPlus · error

archived lookup task failed

Error message

archived lookup task failed: {error}

What it means

This error wraps a JoinError from tokio::task::spawn_blocking in `find_archived_thread_by_title` (apps/codex-plus-launcher/src/main.rs:700). The blocking lookup against archived sessions never returned — the closure panicked or the task was cancelled. Note the inner Result already handles 'not found' via Ok(None); this error means the lookup itself failed to run to completion.

Solutions

  1. Log JoinError::into_panic payload to locate the panic inside the adapter lookup
  2. Fix the panic source so lookup returns Result<_, Error> instead of unwrapping
  3. Await the future to completion; don't cancel mid-lookup
  4. If recurring at shutdown, join pending blocking tasks before exit
Defensive patterns

Strategy: try-catch

Validate before calling

if title.trim().is_empty() { return Ok(None); }

Type guard

fn join_error_is_panic(err: &tokio::task::JoinError) -> bool { err.is_panic() }

Try / catch

match spawn_blocking(move || adapter.find_archived_thread_by_title(&title)).await {
    Ok(Ok(found)) => found,
    Ok(Err(e)) => { eprintln!("lookup error: {e}"); None },
    Err(je) => { eprintln!("lookup task panicked: {je}"); None },
}

Prevention

When it happens

Trigger: Calling `find_archived_thread_by_title(title)` when adapter.find_archived_thread_by_title panics (bad title encoding, db access panic), when the awaiting future is dropped, or at runtime shutdown.

Common situations: Searching archived threads with a title containing characters that trip a panicking decode path; app exit during the search; runtime teardown.

Related errors


AI-assisted analysis of BigPizzaV3/CodexPlusPlus@b1ed92e5e4 (2026-09-19). Data as JSON: /api/errors/e000b1bfa4f3c599. Report an issue: GitHub.

Appendix: source

Thrown at apps/codex-plus-launcher/src/main.rs:700

        .await
        .map_err(|error| anyhow::anyhow!("export markdown task failed: {error}"))
    }

    async fn thread_usage_history(&self, session: SessionRef) -> anyhow::Result<Value> {
        let adapter = self.storage_adapter();
        tokio::task::spawn_blocking(move || adapter.codex_thread_usage_history(&session))
            .await
            .map_err(|error| anyhow::anyhow!("thread usage history task failed: {error}"))
    }

    async fn find_archived_thread_by_title(
        &self,
        title: String,
    ) -> anyhow::Result<Option<SessionRef>> {
        let adapter = self.storage_adapter();
        tokio::task::spawn_blocking(move || adapter.find_archived_thread_by_title(&title))
            .await
            .map_err(|error| anyhow::anyhow!("archived lookup task failed: {error}"))
    }

    async fn recover_remote_control_session(&self, thread_id: String) -> anyhow::Result<Value> {
        let settings = codex_plus_core::settings::SettingsStore::default()
            .load()
            .unwrap_or_default();
        let profile = settings.active_relay_profile();
        if !settings.relay_profiles_enabled
            || profile.relay_mode != codex_plus_core::settings::RelayMode::Official
            || !profile.official_mix_api_key
        {
            return Ok(json!({
                "status": "skipped",
                "message": "Remote Control session recovery is disabled for the active profile"
            }));
        }
        let home = codex_plus_core::codex_sqlite::default_codex_home_dir();
        let target_provider =

View on GitHub (pinned to b1ed92e5e4)