openai/codex · error · ThreadStoreError

thread not found

Error message

thread {thread_id} not found

What it means

ThreadStoreError::ThreadNotFound: the thread-store operation targeted a thread id that has no record in this store. It is the typed store-level signal (used by both in-memory and persistent implementations) that the requested ThreadId does not exist.

Solutions

  1. Verify the thread id (list threads) and correct any transcription or stale-cache error
  2. Create/start the thread before issuing operations against it
  3. If the store was reset or points at a different database, reconnect to the store that actually holds the thread
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at codex-rs/thread-store/src/error.rs:22 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of openai/codex@339751715c (2026-08-25). Data as JSON: /api/errors/3fd12f49f00d57e0. Report an issue: GitHub.

Appendix: source

Thrown at codex-rs/thread-store/src/error.rs:22

/// Result type returned by thread-store operations.
pub type ThreadStoreResult<T> = Result<T, ThreadStoreError>;

pub(crate) fn reject_paginated_history_mode(
    history_mode: ThreadHistoryMode,
) -> ThreadStoreResult<()> {
    if matches!(history_mode, ThreadHistoryMode::Paginated) {
        return Err(ThreadStoreError::Unsupported {
            operation: "paginated_threads",
        });
    }
    Ok(())
}

/// Error type shared by thread-store implementations.
#[derive(Debug, thiserror::Error)]
pub enum ThreadStoreError {
    /// The requested thread does not exist in this store.
    #[error("thread {thread_id} not found")]
    ThreadNotFound {
        /// Thread id requested by the caller.
        thread_id: ThreadId,
    },

    /// The caller supplied invalid request data.
    #[error("invalid thread-store request: {message}")]
    InvalidRequest {
        /// User-facing explanation of the invalid request.
        message: String,
    },

    /// The operation conflicted with current store state.
    #[error("thread-store conflict: {message}")]
    Conflict {
        /// User-facing explanation of the conflict.
        message: String,
    },

View on GitHub (pinned to 339751715c)