BoundaryML/baml · error · io::Error

history boundary {} was not found

Error message

history boundary {} was not found

What it means

open (boundary replay) resolves the boundary directory either from a known dir or by searching configured search roots; if no directory for the BoundaryId exists, it returns NotFound saying the boundary was not found. This is a replay-time error: the on-disk history for that boundary is missing or not in the search path.

Source

Thrown at baml_language/crates/bex_events/src/history/mod.rs:269

    pub fn open(&self, boundary_id: BoundaryId) -> io::Result<Run> {
        let (known_dir, search_roots) = {
            let inner = self
                .inner
                .lock()
                .unwrap_or_else(std::sync::PoisonError::into_inner);
            (
                inner
                    .boundaries
                    .get(&boundary_id)
                    .map(|state| state.path.boundary_dir.clone()),
                inner.search_roots.clone(),
            )
        };
        let dir = known_dir
            .or_else(|| find_boundary_dir(&search_roots, boundary_id))
            .ok_or_else(|| {
                io::Error::new(
                    io::ErrorKind::NotFound,
                    format!(
                        "history boundary {} was not found",
                        boundary_id.to_wire_string()
                    ),
                )
            })?;
        open_boundary_from_dir(&dir)
    }

    pub fn read_value(
        &self,
        boundary_id: BoundaryId,
        value_ref_id: &str,
    ) -> io::Result<Option<HistoryValueBody>> {
        self.read_value_result(boundary_id, value_ref_id)
            .map(HistoryValueReadResult::into_body)
    }

View on GitHub (pinned to bd85ce9dee)

Solutions

  1. Add the directory containing the boundary to the search roots (or pass it as the known dir).
  2. Confirm the boundary ID in the message exists as a directory name under the search roots.
  3. Re-run the recording session to regenerate the history if it was deleted.
  4. Ensure the process that writes history finishes/flushes before open is called.

Example fix

// before
let b = History::open(boundary_id)?;
// after
let b = History::open_in_dir(boundary_id, &recorded_dir)
    .or_else(|_| History::open(boundary_id))?;
Defensive patterns

Strategy: fallback

Validate before calling

let dir = recorded_root.join(boundary_id.to_wire_string());
if !dir.is_dir() {
    return Err(format!("boundary dir {} missing", dir.display()));
}

Try / catch

let boundary = match History::open(boundary_id) {
    Ok(b) => b,
    Err(e) if e.kind() == std::io::ErrorKind::NotFound => {
        History::open_in_dir(boundary_id, &recorded_dir)?
    }
    Err(e) => return Err(e),
};

Prevention

When it happens

Trigger: Calling History::open(boundary_id, ...) where no boundary directory was ever written, the search roots don't include the directory, or the directory name doesn't match the boundary's wire ID.

Common situations: Pointing replay at the wrong history root (test ran in a different temp dir), deleting history files before replay, or a renamed/moved artifacts directory.

Related errors


AI-assisted analysis of BoundaryML/baml@bd85ce9dee (2026-09-12). Data as JSON: /api/errors/f762ec1d20e0cd4d. Report an issue: GitHub.