openai/codex · error · anyhow::Error

thread has a section name without a section id

Error message

thread has a section name without a section id: {name}

What it means

The thread row stores a section_name but no section id. Section identity is keyed by the id column; a name without an id cannot be mapped to a ThreadSection, so the partially-populated row is rejected during from-row conversion.

Solutions

  1. Populate the missing section id on the thread row
  2. Null out both section columns so the thread has no section
  3. Repair the row to match the (id, name) pairing invariant
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at codex-rs/state/src/model/thread_metadata.rs:590 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/724ff8ef2f363fa7. Report an issue: GitHub.

Appendix: source

Thrown at codex-rs/state/src/model/thread_metadata.rs:590

            git_origin_url,
        } = row;
        let thread_source = thread_source
            .map(|thread_source| thread_source.parse())
            .transpose()
            .map_err(anyhow::Error::msg)?;
        let history_mode = history_mode.parse().map_err(anyhow::Error::msg)?;
        let section = match (section, section_name) {
            (Some(id), Some(name)) => {
                Some(ThreadSection::from_row((id, name, section_appearance))?)
            }
            (None, None) => None,
            (Some(id), None) => {
                return Err(anyhow::anyhow!(
                    "thread references an unknown section: {id}"
                ));
            }
            (None, Some(name)) => {
                return Err(anyhow::anyhow!(
                    "thread has a section name without a section id: {name}"
                ));
            }
        };
        Ok(Self {
            id: ThreadId::try_from(id)?,
            rollout_path: PathBuf::from(rollout_path),
            created_at: epoch_millis_to_datetime(created_at)?,
            updated_at: epoch_millis_to_datetime(updated_at)?,
            recency_at: epoch_millis_to_datetime(recency_at)?,
            source,
            history_mode,
            thread_source,
            agent_nickname,
            agent_role,
            agent_path,
            model_provider,
            model,

View on GitHub (pinned to 339751715c)