Hmbown/CodeWhale · error · anyhow::Error
workspace must not be empty
Error message
workspace must not be empty
What it means
Thread-update validation: the `workspace` field was supplied with an empty OS string. Workspace changes have downstream engine effects (see the active-turn guard), so a blank path is rejected up front.
Source
Thrown at crates/tui/src/runtime_threads.rs:4660
if let Some(model) = req.model.as_ref()
&& model.trim().is_empty()
{
bail!("model must not be empty");
}
if let Some(mode) = req.mode.as_ref()
&& mode.trim().is_empty()
{
bail!("mode must not be empty");
}
if let Some(permission_posture) = req.permission_posture.as_ref()
&& permission_posture.trim().is_empty()
{
bail!("permission_posture must not be empty");
}
if let Some(workspace) = req.workspace.as_ref()
&& workspace.as_os_str().is_empty()
{
bail!("workspace must not be empty");
}
let configured_sandbox_mode = self.read_config().sandbox_mode.clone();
let (thread, changes, evicted_engine, posture_engine) = {
// Take the active guard first so a workspace mutation can check
// and evict the cached engine atomically with the durable update.
// Using the same order as start/compact avoids lock inversion.
let mut active = self.active.lock().await;
let _thread_mutation = self.store.thread_mutation.lock();
let mut thread = self
.store
.load_thread(id)
.with_context(|| format!("Thread not found: {id}"))?;
let mut changes = serde_json::Map::new();
let policy_patch = if req.mode.is_some()
|| req.permission_posture.is_some()
|| req.auto_approve.is_some()
{View on GitHub (pinned to 0c42157ee5)
Solutions
- Omit the workspace field if unchanged
- Or pass a valid workspace path
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at crates/tui/src/runtime_threads.rs:4660 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/f75c0624b12bb8d6.
Report an issue: GitHub.