Hmbown/CodeWhale · error · anyhow::Error

prompt is required

Error message

prompt is required

What it means

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.

Source

Thrown at crates/tui/src/runtime_threads.rs:5905

    async fn start_turn_with_source(
        &self,
        thread_id: &str,
        req: StartTurnRequest,
        input_source: RuntimeTurnInputSource,
    ) -> Result<TurnRecord> {
        // Heap-allocate the turn-start state machine. Its future holds two full
        // Config clones plus ThreadRecord/EngineHandle/TurnRecord/TurnItemRecord
        // and the Op::SendMessage, and inlines the large ensure_engine_loaded
        // sub-future (which builds a full EngineConfig), all across ~8 sequential
        // .awaits. On Windows the runtime thread stack is ~1 MiB and this
        // monolithic frame overflowed it (test
        // start_turn_accepts_dynamic_tools_and_environment_id on windows-latest,
        // STATUS_STACK_OVERFLOW). Box::pin moves the whole frame to the heap so
        // no caller's stack carries it; behavior is unchanged.
        Box::pin(async move {
        let prompt = req.prompt.trim().to_string();
        if prompt.is_empty() {
            bail!("prompt is required");
        }

        let thread = self.get_thread(thread_id).await?;
        let policy =
            if req.mode.is_some() || req.permission_posture.is_some() || req.auto_approve.is_some()
            {
                runtime_policy_with_overrides(
                    &thread,
                    req.mode.as_deref(),
                    req.permission_posture.as_deref(),
                    req.auto_approve,
                )?
            } else {
                RuntimePolicyProjection::from_persisted(
                    &thread.mode,
                    thread.permission_posture.as_deref(),
                    thread.auto_approve,
                )

View on GitHub (pinned to 0c42157ee5)

Solutions

  1. Include non-empty prompt text
  2. Retry the turn request
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at crates/tui/src/runtime_threads.rs:5905 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/c1aa343b50b26700. Report an issue: GitHub.