Skip to content

[Feature]: Auto-retry failed scene generation with exponential backoff #755

Description

@YizukiAme

Problem or Motivation

When generating course content, any single scene generation failure immediately pauses the entire generation queue. Users must manually click "Retry" to continue, which breaks the flow of teaching - especially problematic given OpenMAIC's core advantage of asynchronous generation (users can teach while slides generate in the background).

Through testing with high-performance models like Zhipu's GLM-5.2, I've observed that generation errors occur randomly and frequently - often happening on nearly every generation attempt. These failures are typically transient (API rate limits, temporary timeouts, network hiccups) and resolve with a single retry. The issue can be even more pronounced with weaker or more cost-effective models that many users rely on.

The current "fail once, stop everything" approach undermines the async generation experience, forcing users to wait mid-lecture instead of just waiting for the first slide.

Proposed Solution

Implement automatic retry logic similar to mature AI coding tools (Claude Code, Cursor, Codex):

  1. Auto-retry mechanism:

    • Automatically retry 3-5 times for retryable errors (5xx, 429 rate limits, timeouts)
    • Use exponential backoff strategy (1s → 2s → 4s → 8s → 16s)
    • Distinguish non-retryable errors (401 auth, 400 bad request) - fail immediately for these
  2. Non-blocking feedback (optional):

    • Show "Retrying (2/5)" status on the sidebar card
    • Display a dismissible banner at the top of sidebar after 3 failed attempts: "Some pages failed to generate, click to review"

This preserves the user's teaching flow while silently handling transient errors in the background.

Area

Classroom generation

Additional Context

If maintainers agree this is a reasonable direction, I'm willing to submit a PR implementing the auto-retry mechanism in the next few days :-)

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions