BigPizzaV3/CodexPlusPlus · error · anyhow::Error

Session file export is unavailable

Error message

Session file export is unavailable

What it means

export_session_file returns this sentinel error from the BridgeDataService-trait-based handler when session file export has no backing implementation (the default/placeholder service). It indicates the operation is not wired up in this build rather than a per-session failure.

Solutions

  1. Switch to a backend implementing export_session_file
  2. Catch and surface 'export unsupported' in the caller
  3. Gate the export UI action on backend capability

Example fix

// before
let exported = store.export_session_file(session).await?;
// after
let exported = store.export_session_file(session).await.map_err(|e| if e.to_string().contains("unavailable") { ExportUnsupported } else { e.into() })?;
Defensive patterns

Strategy: fallback

Try / catch

match store.export_session_file(session).await {
    Ok(v) => write_export(v),
    Err(e) if e.to_string().contains("unavailable") => show_unsupported_message(),
    Err(e) => return Err(e.into()),
}

Prevention

When it happens

Trigger: Calling export_session_file on a backend that relies on the trait default instead of providing an override.

Common situations: Minimal or in-memory backend in tests; bridge routing to a store variant lacking export support.

Related errors


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

Appendix: source

Thrown at crates/codex-plus-core/src/routes.rs:123

    async fn upstream_worktree_prepare(&self, payload: Value) -> anyhow::Result<Value>;
    async fn upstream_worktree_create(&self, payload: Value) -> anyhow::Result<Value>;
}

#[async_trait]
pub trait BridgeDataService: Send + Sync {
    async fn delete(&self, session: SessionRef) -> anyhow::Result<DeleteResult>;
    async fn undo(&self, undo_token: String) -> anyhow::Result<DeleteResult>;
    async fn export_markdown(&self, session: SessionRef) -> anyhow::Result<ExportResult>;
    async fn thread_usage_history(&self, session: SessionRef) -> anyhow::Result<Value>;
    async fn find_archived_thread_by_title(
        &self,
        title: String,
    ) -> anyhow::Result<Option<SessionRef>>;
    async fn recover_remote_control_session(&self, _thread_id: String) -> anyhow::Result<Value> {
        anyhow::bail!("Remote Control session recovery is unavailable")
    }
    async fn export_session_file(&self, _session: SessionRef) -> anyhow::Result<Value> {
        anyhow::bail!("Session file export is unavailable")
    }
    async fn import_session_file(&self, _payload: Value) -> anyhow::Result<Value> {
        anyhow::bail!("Session file import is unavailable")
    }
}

pub async fn handle_bridge_request(
    ctx: BridgeContext,
    path: &str,
    payload: Value,
) -> serde_json::Value {
    let started = Instant::now();
    let _ = crate::diagnostic_log::append_diagnostic_log(
        "bridge.request",
        json!({
            "path": path,
            "payload_keys": payload
                .as_object()

View on GitHub (pinned to b1ed92e5e4)