Hmbown/CodeWhale · error

Kimi web-search Formula fiber did not succeed

Error message

Kimi web-search Formula fiber did not succeed

What it means

The Kimi Formula flow runs the web-search function as a fiber (server-side execution). After awaiting the fiber, the client checks payload.status == "succeeded" before reading the output; a failed, pending, or unrecognized status means no usable search result, so it bails. On success it extracts /context/output or /context/encrypted_output as a string.

Solutions

  1. Log the full fiber payload to see the actual status/error detail
  2. If status is transient (running/queued), poll/await the fiber to completion before reading the result
  3. Retry the search request if the fiber failed due to a transient upstream issue
  4. Update the status/output field extraction if the Kimi fiber schema changed

Example fix

// before
if payload.get("status").and_then(Value::as_str) != Some("succeeded") {
    bail!("Kimi web-search Formula fiber did not succeed");
}
// after: include the upstream status in the error
let status = payload.get("status").and_then(Value::as_str).unwrap_or("<missing>");
if status != "succeeded" {
    bail!("Kimi web-search Formula fiber did not succeed (status: {status})");
}
Defensive patterns

Strategy: retry

Validate before calling

// inspect status before extracting output
let status = payload.get("status").and_then(Value::as_str).unwrap_or("<missing>");
if status != "succeeded" { eprintln!("fiber status: {status}"); }

Type guard

fn fiber_succeeded(payload: &Value) -> bool {
    payload.get("status").and_then(Value::as_str) == Some("succeeded")
}

Try / catch

match fiber_result {
    Err(e) if e.to_string().contains("did not succeed") => {
        // transient upstream failure: retry once, then give up
        tokio::time::sleep(Duration::from_secs(2)).await;
        retry_search(req).await
    }
    other => other,
}

Prevention

When it happens

Trigger: formula_fiber_result receives a fiber payload whose status field is absent or anything other than "succeeded" (e.g. "failed", "running", "timeout").

Common situations: Upstream Kimi fiber execution failure (search backend outage); polling too early while the fiber is still running; a payload schema change moving/renaming the status or output fields.

Related errors


AI-assisted analysis of Hmbown/CodeWhale@73e0f67d83 (2026-09-22). Data as JSON: /api/errors/3ae274fefc043dda. Report an issue: GitHub.

Appendix: source

Thrown at crates/tui/src/client/provider_native_search/kimi.rs:245

fn formula_web_search_tools(payload: &Value) -> Result<Value> {
    let tools = payload
        .get("tools")
        .and_then(Value::as_array)
        .context("Kimi web-search Formula omitted tools")?;
    if tools.len() != 1
        || tools[0].get("type").and_then(Value::as_str) != Some("function")
        || tools[0].pointer("/function/name").and_then(Value::as_str)
            != Some(WEB_SEARCH_FORMULA_FUNCTION)
    {
        bail!("Kimi web-search Formula returned an unexpected tool declaration");
    }
    Ok(Value::Array(tools.clone()))
}

fn formula_fiber_result(payload: &Value) -> Result<&str> {
    if payload.get("status").and_then(Value::as_str) != Some("succeeded") {
        bail!("Kimi web-search Formula fiber did not succeed");
    }
    payload
        .pointer("/context/output")
        .or_else(|| payload.pointer("/context/encrypted_output"))
        .and_then(Value::as_str)
        .map(str::trim)
        .filter(|result| !result.is_empty())
        .context("Kimi web-search Formula fiber omitted its result")
}

fn builtin_search_tools() -> Value {
    json!([{
        "type": "builtin_function",
        "function": { "name": "$web_search" }
    }])
}

fn parse_kimi_code(payload: &Value) -> ProviderNativeSearchResponse {

View on GitHub (pinned to 73e0f67d83)