openai/codex · error

status history rate-limit state poisoned

Error message

status history rate-limit state poisoned

What it means

Bailed (expect-style) by finish_rate_limit_refresh when the RwLock guarding /status rate-limit display state is poisoned — another thread panicked while holding it. The TUI status card can no longer update rate-limit data; this is an internal liveness failure, not user input.

Solutions

  1. Fix the panic inside the lock's critical section that poisoned the lock
  2. Use lock handling that tolerates poisoning (into_inner / recover from PoisonError) instead of expect
  3. Restart the TUI to get unpoisoned state
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at codex-rs/tui/src/status/card.rs:105 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/74678a75e29dd6b2. Report an issue: GitHub.

Appendix: source

Thrown at codex-rs/tui/src/status/card.rs:105

    pub(crate) fn reserve_thread_usage_label_width(&self) {
        self.thread_usage.reserve_label_width();
    }

    pub(crate) fn finish_rate_limit_refresh(
        &self,
        rate_limits: &[RateLimitSnapshotDisplay],
        now: DateTime<Local>,
    ) {
        let rate_limits = if rate_limits.len() <= 1 {
            compose_rate_limit_data(rate_limits.first(), now)
        } else {
            compose_rate_limit_data_many(rate_limits, now)
        };
        #[expect(clippy::expect_used)]
        let mut state = self
            .rate_limit_state
            .write()
            .expect("status history rate-limit state poisoned");
        state.rate_limits = rate_limits;
        state.refreshing_rate_limits = false;
    }

    pub(crate) fn set_thread_usage(
        &self,
        estimate: Option<codex_app_server_protocol::ThreadUsage>,
    ) {
        self.thread_usage.set_estimate(estimate);
    }
}

#[derive(Debug)]
struct StatusHistoryCell {
    model_name: String,
    model_details: Vec<String>,
    directory: PathBuf,
    permissions: String,

View on GitHub (pinned to 339751715c)