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
rename_thread_section refuses to modify the built-in pinned section (id == PINNED_THREAD_SECTION_ID). The pinned section is a stable system-defined bucket, not a user-created custom section, so its name cannot be renamed.
Solutions
- Skip the rename call for the built-in pinned section id
- Create a custom section with the desired name and move threads into it instead
Defensive patterns
Strategy: validation
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.
Appendix: 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)