openai/codex · error · anyhow::Error

built-in pinned thread section cannot be renamed

Error message

built-in pinned thread section cannot be renamed

What it means

Error "built-in pinned thread section cannot be renamed" thrown in openai/codex.

Source

Thrown at codex-rs/state/src/runtime/thread_sections.rs:44

                    .as_ref()
                    .map(serde_json::to_string)
                    .transpose()?,
            )
            .execute(self.pool.as_ref())
            .await?;

        Ok(section)
    }

    /// Rename a custom thread section without changing its stable identity.
    pub async fn rename_thread_section(
        &self,
        id: &str,
        name: &str,
        appearance: Option<Option<ThreadSectionAppearance>>,
    ) -> anyhow::Result<Option<ThreadSection>> {
        if id == PINNED_THREAD_SECTION_ID {
            anyhow::bail!("built-in pinned thread section cannot be renamed");
        }

        let replace_appearance = appearance.is_some();
        let appearance = appearance
            .flatten()
            .map(|appearance| serde_json::to_string(&appearance))
            .transpose()?;
        let section = sqlx::query_as::<_, (String, String, Option<String>)>(
            "UPDATE thread_sections SET name = ?, appearance = CASE WHEN ? THEN ? ELSE appearance END WHERE id = ? RETURNING id, name, appearance",
        )
        .bind(name)
        .bind(replace_appearance)
        .bind(appearance)
        .bind(id)
        .fetch_optional(self.pool.as_ref())
        .await?;

        section.map(ThreadSection::from_row).transpose()

View on GitHub (pinned to 339751715c)

When it happens

Trigger: Thrown at codex-rs/state/src/runtime/thread_sections.rs:44 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/fe6a78f873dc45da. Report an issue: GitHub.