HKUDS/DeepTutor · error · GenerationFailure

LLM returned no deep-dive suggestions.

Error message

LLM returned no deep-dive suggestions.

What it means

The deep_dive block asks the LLM for a list of deep-dive topic suggestions; after filtering/parsing, zero valid suggestions remain, so GenerationFailure is raised. It means the LLM response either contained no items, or every item failed the minimal extraction (e.g. missing/blank topic).

Source

Thrown at deeptutor/book/blocks/deep_dive.py:61

            expected_key="suggestions",
        )
        suggestions_raw = data.get("suggestions") if isinstance(data, dict) else None
        suggestions: list[dict[str, str]] = []
        if isinstance(suggestions_raw, list):
            for item in suggestions_raw[:5]:
                if not isinstance(item, dict):
                    continue
                topic = str(item.get("topic") or "").strip()
                if not topic:
                    continue
                suggestions.append(
                    {
                        "topic": topic[:160],
                        "rationale": str(item.get("rationale") or "").strip()[:300],
                    }
                )
        if not suggestions:
            raise GenerationFailure("LLM returned no deep-dive suggestions.")
        return (
            {"suggestions": suggestions},
            [],
            data.get("_metadata") if isinstance(data.get("_metadata"), dict) else {},
        )


__all__ = ["DeepDiveGenerator"]

View on GitHub (pinned to 3e82f13042)

Solutions

  1. Retry the generation — transient empty LLM responses often succeed on retry
  2. Inspect the raw LLM payload logging to confirm whether 'suggestions' was empty or items were dropped by parsing
  3. Tighten the prompt (explicit JSON schema, minimum N suggestions) or lower temperature so the model doesn't return refusals
  4. If parsing drops items, relax the extraction so items with any non-empty topic survive
Defensive patterns

Strategy: retry

Try / catch

for attempt in range(2):
    try:
        return await deep_dive_block.generate(ctx)
    except GenerationFailure as exc:
        if 'no deep-dive suggestions' in str(exc) and attempt == 0:
            continue
        raise

Prevention

When it happens

Trigger: Calling deep_dive _generate when the LLM returns an empty suggestions list, a malformed payload whose items all lack a usable 'topic' field, or when topics are blank after strip(). Any of these leaves the suggestions list empty at the guard.

Common situations: LLM refuses or returns a refusal/clarification instead of JSON; JSON parsing produced an empty list silently; over-aggressive item filtering (topic[:160] on empty strings); prompt/schema drift after a model or prompt-template change.

Related errors


AI-assisted analysis of HKUDS/DeepTutor@3e82f13042 (2026-08-27). Data as JSON: /api/errors/ec52a5ea6dcc7941. Report an issue: GitHub.