openai/codex · error

failed to determine the working directory recorded for the s

Error message

failed to determine the working directory recorded for the selected session

What it means

Error "failed to determine the working directory recorded for the selected session" thrown in openai/codex.

Source

Thrown at codex-rs/tui/src/session_resume.rs:130

    state_db_ctx: Option<&StateRuntime>,
    target_session: &SessionTarget,
    action: CwdPromptAction,
    cwd_context: ResumeCwdContext<'_>,
) -> color_eyre::Result<ResolveCwdOutcome> {
    if matches!(cwd_context.mode, Some(ResumeCwdMode::Current)) {
        return Ok(ResolveCwdOutcome::Continue(Some(
            cwd_context.remembered_current_cwd.to_path_buf(),
        )));
    }
    let Some(history_cwd) = read_session_cwd(
        state_db_ctx,
        target_session.thread_id,
        target_session.path.as_deref(),
    )
    .await
    else {
        if matches!(cwd_context.mode, Some(ResumeCwdMode::Session)) {
            color_eyre::eyre::bail!(
                "failed to determine the working directory recorded for the selected session"
            );
        }
        return Ok(ResolveCwdOutcome::Continue(None));
    };
    match cwd_context.mode {
        Some(ResumeCwdMode::Session) => {
            return Ok(ResolveCwdOutcome::Continue(Some(history_cwd)));
        }
        Some(ResumeCwdMode::Current) | None => {}
    }
    if cwds_differ(cwd_context.current_cwd, &history_cwd) {
        let selection_outcome = cwd_prompt::run_cwd_selection_prompt(
            tui,
            config,
            action,
            cwd_context.current_cwd,
            &history_cwd,

View on GitHub (pinned to 339751715c)

When it happens

Trigger: Thrown at codex-rs/tui/src/session_resume.rs:130 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/b2313fff5a3045f8. Report an issue: GitHub.