Skip to content

fix: stop Gemini outages from producing template videos - #88

Closed
panganesh wants to merge 2 commits into
darkzOGx:masterfrom
panganesh:fix/gemini-retry-template-guard
Closed

panganesh wants to merge 2 commits into
darkzOGx:masterfrom
panganesh:fix/gemini-retry-template-guard

Conversation

@panganesh

Copy link
Copy Markdown

What

Gemini outages and cut-off replies were silently turning plans, strategies and scripts into placeholder templates, which then reached the approval queue.

Changes

  • Retry Gemini text calls on 503/429 with backoff (2s, 4s), then fall back to gemini-3.5-flash-lite. GEMINI_FALLBACK_MODELS overrides the list; empty disables it.
  • Retry any MAX_TOKENS reply with a larger budget, not only empty ones. Thinking models were cutting JSON off mid-string. Raised the plan (6000), strategy (4000), script (8192) and SEO (4000) token budgets.
  • Template-fallback scripts are flagged (metadata.generationSource: 'template'), and a new blocking script_source quality check stops them from being approved or scheduled. Older template scripts are caught by their placeholder lines.

Testing

  • New tests: Gemini Transient Retry and Fallback; Template Script Guard.
  • Full suite: 52/52 pass, run against a copy of the local database.
  • Live: the operator now produces an AI-written plan and script ("Designing Multi-Agent Workflows for IT Delivery").

Set BRAND_LOGO_PATH (plus optional position, height, margin and opacity)
to overlay a logo on every assembled or rebuilt video. Without the setting,
or when the file is missing, the video stream is copied as before.
- Retry Gemini text calls on 503/429 with backoff, then fall back to
  gemini-3.5-flash-lite (GEMINI_FALLBACK_MODELS overrides the list).
- Retry any MAX_TOKENS reply with a larger budget, not only empty ones:
  thinking models were cutting JSON off mid-string. Raise the plan,
  strategy, script and SEO token budgets to match real output sizes.
- Flag template-fallback scripts and add a blocking script_source quality
  check, so placeholder narration can no longer be approved or scheduled.
@panganesh panganesh closed this Oct 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant