{"record":{"id":"c1aa343b50b26700","repo":"Hmbown/CodeWhale","slug":"prompt-is-required","errorCode":null,"errorMessage":"prompt is required","messagePattern":"prompt is required","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/tui/src/runtime_threads.rs","lineNumber":5905,"sourceCode":"    async fn start_turn_with_source(\n        &self,\n        thread_id: &str,\n        req: StartTurnRequest,\n        input_source: RuntimeTurnInputSource,\n    ) -> Result<TurnRecord> {\n        // Heap-allocate the turn-start state machine. Its future holds two full\n        // Config clones plus ThreadRecord/EngineHandle/TurnRecord/TurnItemRecord\n        // and the Op::SendMessage, and inlines the large ensure_engine_loaded\n        // sub-future (which builds a full EngineConfig), all across ~8 sequential\n        // .awaits. On Windows the runtime thread stack is ~1 MiB and this\n        // monolithic frame overflowed it (test\n        // start_turn_accepts_dynamic_tools_and_environment_id on windows-latest,\n        // STATUS_STACK_OVERFLOW). Box::pin moves the whole frame to the heap so\n        // no caller's stack carries it; behavior is unchanged.\n        Box::pin(async move {\n        let prompt = req.prompt.trim().to_string();\n        if prompt.is_empty() {\n            bail!(\"prompt is required\");\n        }\n\n        let thread = self.get_thread(thread_id).await?;\n        let policy =\n            if req.mode.is_some() || req.permission_posture.is_some() || req.auto_approve.is_some()\n            {\n                runtime_policy_with_overrides(\n                    &thread,\n                    req.mode.as_deref(),\n                    req.permission_posture.as_deref(),\n                    req.auto_approve,\n                )?\n            } else {\n                RuntimePolicyProjection::from_persisted(\n                    &thread.mode,\n                    thread.permission_posture.as_deref(),\n                    thread.auto_approve,\n                )","sourceCodeStart":5887,"sourceCodeEnd":5923,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/0c42157ee52f9d55af2b506d71b46249910f77d3/crates/tui/src/runtime_threads.rs#L5887-L5923","documentation":"Guard inside start_turn_with_source rejecting a StartTurnRequest whose prompt field is empty/missing. Turn records require user input text to seed the model turn; an empty prompt would create a turn with nothing to send, so the runtime refuses before allocating the turn-start state machine. Fires when callers submit a StartTurnRequest without populated prompt text.","triggerScenarios":"Thrown at crates/tui/src/runtime_threads.rs:5905 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Include non-empty prompt text","Retry the turn request"],"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"}