GEMINI LABJP
3.8LIVE — Two audio-to-audio models reached GA for the Live API: gemini-3.8-live as the low-latency default, and -extended-thinking for background reasoning mid-conversation09/30 — Thirteen days until gemini-omni-flash-preview shuts down. The replacement is gemini-omni-1.1-flash, so count your call sites before you swapMCP — A timeout written as ten minutes on the extension side is reportedly cutting out at one. Anyone handing long work to an MCP server runs straight into itNEW — When an AI function in Sheets refuses to generate, suspect where the file lives before you blame the 24-hour capGEM — When a Gem built for your team will not share, walk the admin settings and the Drive sharing settings in a set order10/16 — Twenty-nine days until Gemini 2.5 Pro, Flash and Flash-Lite shut down together. The path forward is the 3.5 Flash line3.8LIVE — Two audio-to-audio models reached GA for the Live API: gemini-3.8-live as the low-latency default, and -extended-thinking for background reasoning mid-conversation09/30 — Thirteen days until gemini-omni-flash-preview shuts down. The replacement is gemini-omni-1.1-flash, so count your call sites before you swapMCP — A timeout written as ten minutes on the extension side is reportedly cutting out at one. Anyone handing long work to an MCP server runs straight into itNEW — When an AI function in Sheets refuses to generate, suspect where the file lives before you blame the 24-hour capGEM — When a Gem built for your team will not share, walk the admin settings and the Drive sharing settings in a set order10/16 — Twenty-nine days until Gemini 2.5 Pro, Flash and Flash-Lite shut down together. The path forward is the 3.5 Flash line
Articles/Dev Tools
Dev Tools/2026-06-18Advanced

Keeping Nightly Batches Alive After the Gemini CLI Stops Responding: A google-genai SDK Fallback

On June 18 the Gemini CLI stops answering requests. Here is a small fallback harness that probes whether the CLI can still respond and quietly reroutes unattended batch jobs to the google-genai SDK, built from my own automation.

Gemini CLI8fallback3automation54google-genai6production140

Premium Article

On June 18, the Gemini CLI stops answering requests on the host side. As an indie developer running several sites that publish on a nightly schedule, I only realized how deeply that one command was wired into my pipeline once I started preparing for the cutover. I assumed gemini -p "..." was only doing article generation, but the same command was quietly buried in screenshot caption work and in pre-publish title proofreading too.

The tricky part is that the gemini binary is still found by which gemini after June 18. What stops is the host response, not the local command. So if you judge liveness by "does the binary exist," you mistake a dead CLI for a live one, and your batch builds a mountain of timeouts. I wrote my first probe with --version, which passed in testing but left only the production nightly batch hanging.

This is not a migration inventory. Rather than the broad plan of finding every place you depend on the CLI, I want to go deep on a single piece after that audit is done: a small harness that keeps work moving even when the CLI goes silent.

Which work to reroute to the SDK, and which to keep on the CLI

Moving everything to the SDK is the safe choice, but you give up the interactive completions and project-context loading that make the CLI pleasant to use. I sorted my work into three buckets before touching any code.

Nature of the workDestinationWhy
Unattended nightly batch generationSDK directlyNo interaction needed; must run independently of the CLI
Interactive local experimentationAntigravity CLIKeep context retention and the conversational feel
One-shot calls inside CISDK directlyPrefer reproducibility and an audit trail

The more unattended a job is, the more it belongs on the SDK. Only work where a person is in front of the screen stays on the CLI (the Antigravity CLI after migration); everything else escapes to the API. The code below is narrowed to one goal: keeping unattended batches alive.

Checking whether the CLI can respond right now

The key to the check is not whether the binary exists, but whether one real response comes back. Send a short prompt; if it times out or exits non-zero, treat the CLI as unusable.

import shutil
import subprocess
 
def cli_available(timeout_sec: int = 12) -> bool:
    """Check whether the gemini CLI can answer right now.
    The point is to try one real generation instead of --version.
    The binary can remain while the host side no longer responds."""
    if shutil.which("gemini") is None:
        return False
    try:
        result = subprocess.run(
            ["gemini", "-p", "ping"],
            capture_output=True,
            text=True,
            timeout=timeout_sec,
        )
    except subprocess.TimeoutExpired:
        return False
    return result.returncode == 0 and bool(result.stdout.strip())

I keep timeout_sec short, at 12 seconds, because waiting minutes on a probe defeats the purpose. A shut-down CLI never returns a response, so the longer you wait, the more you waste. A probe should knock lightly and give up fast.

Thank you for reading this far.

Continue Reading

What follows includes implementation code, benchmarks, and practical content we hope you'll find useful. This site runs without ads — server and development costs are supported entirely by members like you. If it's been helpful, we'd be truly grateful for your support.

WHAT YOU'LL LEARN
Detect the state where the gemini binary still exists but no longer answers, using a real one-shot generation instead of --version
Collapse CLI-first and SDK-fallback into a single generate() with exponential backoff, so calls survive the shutdown
Add a 16-character idempotency key to nightly jobs to stop duplicate publishing on re-runs
Secure payment via Stripe · Cancel anytime

Unlock This Article

Get full access to the rest of this article. Buy once, read anytime. This site is ad-free — your support goes directly toward keeping it running.

or
Unlock all articles with Membership →
Share

Thank You for Reading

Gemini Lab is ad-free, supported entirely by members like you. We publish practical guides daily with implementation code, benchmarks, and production-ready patterns. If you've found it useful, we'd love to have you on board.

  • Copy-paste ready implementation code
  • New advanced guides published daily
  • $5/mo or $15 for lifetime access
View Membership →

Related Articles

Dev Tools2026-05-04
Gemini CLI with MCP Servers: A from File I/O to Database Queries
Learn how to connect MCP servers to Gemini CLI for hands-on file operations and database integration. Covers GEMINI.md configuration, filesystem, SQLite, and GitHub MCP with working examples.
Dev Tools2026-03-11
Wiring Gemini CLI into Your Shell and CI — Headless Runs and Session Resume
Move past interactive use of Gemini CLI: headless runs, JSON output, session resume, approval modes, and MCP. Includes the five ways headless runs break and a measured pro/flash comparison.
Dev Tools2026-09-15
The approval rules I had written never matched once — auditing my Gemini CLI policies
A deny rule I trusted for half a year had never matched. The pattern was tested against a JSON string, the folder I kept my rules in is not read, and ask_user turns into deny the moment nobody is watching. Here is the audit, and the script I wrote to keep doing it.
📚RECOMMENDED BOOKS
Build a Large Language Model (From Scratch)
Sebastian Raschka
LLM Dev
Prompt Engineering for LLMs
Berryman & Ziegler
Prompting
AI Engineering
Chip Huyen
AI Eng
* Contains affiliate links