Hmbown/CodeWhale · error · std::io::Error
managed directory path cannot contain traversal components
Error message
managed directory path cannot contain traversal components
What it means
Traversal guard in normalize_managed_dir: a relative managed-directory path contains ParentDir, Prefix, or RootDir components, which could escape the intended base directory. Such paths are rejected so managed session storage cannot be redirected outside its root.
Source
Thrown at crates/tui/src/session_manager.rs:65
const fn default_queue_schema_version() -> u32 {
CURRENT_QUEUE_SCHEMA_VERSION
}
fn normalize_managed_dir(path: PathBuf) -> std::io::Result<PathBuf> {
if path.as_os_str().is_empty() {
return Err(std::io::Error::new(
std::io::ErrorKind::InvalidInput,
"managed directory path cannot be empty",
));
}
if path.components().any(|component| {
matches!(
component,
Component::ParentDir | Component::Prefix(_) | Component::RootDir
)
}) && path.is_relative()
{
return Err(std::io::Error::new(
std::io::ErrorKind::InvalidInput,
"managed directory path cannot contain traversal components",
));
}
if path.is_absolute() {
return Ok(path);
}
std::env::current_dir().map(|cwd| cwd.join(path))
}
/// Persisted queued message for offline/degraded mode.
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct QueuedSessionMessage {
pub display: String,
#[serde(default)]
pub skill_instruction: Option<String>,
#[serde(default)]
pub skill_provenance: Option<crate::plugins::types::PluginAuthority>,View on GitHub (pinned to 0c42157ee5)
Solutions
- Configure a plain relative path (no `..`, no drive/root prefix) for the managed directory.
- Resolve any absolute or parent-relative path to the intended base directory before passing it in.
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at crates/tui/src/session_manager.rs:65 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/4d62ceef4f4e1abb.
Report an issue: GitHub.