nikivdev/code · error

Gemini returned empty summary

Error message

Gemini returned empty summary

What it means

Error "Gemini returned empty summary" thrown in nikivdev/code.

Source

Thrown at src/ai.rs:14641

        .context("failed to call Gemini API")?;

    if !resp.status().is_success() {
        let status = resp.status();
        let text = resp.text().unwrap_or_default();
        bail!("Gemini API error {}: {}", status, text);
    }

    let parsed: GeminiResponse = resp.json().context("failed to parse Gemini response")?;
    let content = parsed
        .candidates
        .get(0)
        .and_then(|c| c.content.parts.get(0))
        .and_then(|p| p.text.as_deref())
        .unwrap_or("")
        .trim();

    if content.is_empty() {
        bail!("Gemini returned empty summary");
    }

    let summary_payload = parse_summary_response(content)?;

    Ok(SessionSummary {
        summary: summary_payload.summary,
        chapters: summary_payload.chapters,
        session_last_timestamp: None,
        model,
        updated_at: chrono::Utc::now().to_rfc3339(),
    })
}

fn summarize_handoff_with_gemini(context: &str) -> Result<String> {
    let api_key = get_gemini_api_key()?;
    let model = gemini_model();

    let prompt = format!(

View on GitHub (pinned to a747e741ae)

When it happens

Trigger: Thrown at src/ai.rs:14641 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of nikivdev/code@a747e741ae (2026-09-01). Data as JSON: /api/errors/e989d2ef71c1caff. Report an issue: GitHub.