{"record":{"id":"60836c553757d1bc","repo":"Hmbown/CodeWhale","slug":"mode-must-not-be-empty","errorCode":null,"errorMessage":"mode must not be empty","messagePattern":"mode must not be empty","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/tui/src/runtime_threads.rs","lineNumber":4650,"sourceCode":"            && req.model.is_none()\n            && req.mode.is_none()\n            && req.permission_posture.is_none()\n            && req.title.is_none()\n            && req.system_prompt.is_none()\n            && req.workspace.is_none()\n        {\n            bail!(\"At least one thread field is required\");\n        }\n\n        if let Some(model) = req.model.as_ref()\n            && model.trim().is_empty()\n        {\n            bail!(\"model must not be empty\");\n        }\n        if let Some(mode) = req.mode.as_ref()\n            && mode.trim().is_empty()\n        {\n            bail!(\"mode must not be empty\");\n        }\n        if let Some(permission_posture) = req.permission_posture.as_ref()\n            && permission_posture.trim().is_empty()\n        {\n            bail!(\"permission_posture must not be empty\");\n        }\n        if let Some(workspace) = req.workspace.as_ref()\n            && workspace.as_os_str().is_empty()\n        {\n            bail!(\"workspace must not be empty\");\n        }\n\n        let configured_sandbox_mode = self.read_config().sandbox_mode.clone();\n        let (thread, changes, evicted_engine, posture_engine) = {\n            // Take the active guard first so a workspace mutation can check\n            // and evict the cached engine atomically with the durable update.\n            // Using the same order as start/compact avoids lock inversion.\n            let mut active = self.active.lock().await;","sourceCodeStart":4632,"sourceCodeEnd":4668,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/0c42157ee52f9d55af2b506d71b46249910f77d3/crates/tui/src/runtime_threads.rs#L4632-L4668","documentation":"Thread-update validation in runtime_threads: the request included a `mode` field whose value is empty after trimming. Optional fields are only assigned when present, so an explicitly blank mode is rejected instead of corrupting the thread's mode state.","triggerScenarios":"Thrown at crates/tui/src/runtime_threads.rs:4650 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Omit the mode field entirely if unchanged","Or pass a real mode value"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"0c42157ee52f9d55af2b506d71b46249910f77d3","analyzedAt":"2026-08-20T21:50:45.477Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}