Hmbown/CodeWhale · error · std::io::Error

Session goal store {} was not created

Error message

Session goal store {} was not created

What it means

Post-creation invariant guard in ensure_session_goals_dir: create_dir reported success or AlreadyExists, but the subsequent existence/type re-check still finds no valid directory — the store could not be confirmed to exist after creation.

Source

Thrown at crates/tui/src/session_manager.rs:978

                    dir.display()
                ),
            ));
        }
        Ok(Some(dir))
    }

    fn ensure_session_goals_dir(&self) -> std::io::Result<PathBuf> {
        if let Some(dir) = self.checked_existing_session_goals_dir()? {
            return Ok(dir);
        }
        let dir = self.session_goals_dir();
        match fs::create_dir(&dir) {
            Ok(()) => {}
            Err(error) if error.kind() == io::ErrorKind::AlreadyExists => {}
            Err(error) => return Err(error),
        }
        self.checked_existing_session_goals_dir()?.ok_or_else(|| {
            io::Error::new(
                io::ErrorKind::NotFound,
                format!("Session goal store {} was not created", dir.display()),
            )
        })
    }

    fn validated_session_goal_path(&self, session_id: &str) -> std::io::Result<PathBuf> {
        let id = self.validated_session_id(session_id)?;
        Ok(self.session_goals_dir().join(format!("{id}.json")))
    }

    fn checked_existing_session_goal_file(path: &Path) -> std::io::Result<bool> {
        let metadata = match fs::symlink_metadata(path) {
            Ok(metadata) => metadata,
            Err(error) if error.kind() == io::ErrorKind::NotFound => return Ok(false),
            Err(error) => return Err(error),
        };
        if metadata.file_type().is_symlink() || !metadata.is_file() {

View on GitHub (pinned to 0c42157ee5)

Solutions

  1. Retry the operation; a transient race may have removed the directory.
  2. Investigate external processes (cleaners, sync tools) deleting the sessions directory.
  3. Check filesystem health if creation consistently fails to persist.
Defensive patterns

Strategy: retry

When it happens

Trigger: Thrown at crates/tui/src/session_manager.rs:978 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of Hmbown/CodeWhale@0c42157ee5 (2026-08-20). Data as JSON: /api/errors/4c468759cf62b883. Report an issue: GitHub.