graphify
graphify copied to clipboard
Document Gemini free-tier quota behavior (daily cap vs per-minute) — retries currently waste time against an unrecoverable wall
Summary
When GEMINI_API_KEY/GOOGLE_API_KEY is set, SKILL.md directs the pipeline to graphify.llm.extract_corpus_parallel(files, backend="gemini"). On a free-tier key, two different quota errors can occur, and only one of them is recoverable by retrying:
generativelanguage.googleapis.com/generate_content_free_tier_input_token_count(per-minute,GenerateContentInputTokensPerModelPerMinute-FreeTier) — recoverable; waiting ~60s and reducingmax_concurrencyclears it.generativelanguage.googleapis.com/generate_content_free_tier_requests(per-day,GenerateRequestsPerDayPerProjectPerModel-FreeTier, observed limit: 20 requests/day ongemini-3-flash) — not recoverable by retrying, backing off, or reducing concurrency. Every retry against this wall just burns another one of the ~20 daily requests for no benefit.
I spent three retry cycles (with backoff, then with max_concurrency=1) before recognizing the second error was a hard daily cap, not a transient rate limit, and falling back to subagent dispatch.
Proposed fix
- Document both error classes explicitly in the skill's Gemini section, with the literal string to match on (
generate_content_free_tier_requestsvsgenerate_content_free_tier_input_token_count). - Instruction: on the daily-cap error, stop retrying immediately and fall back to subagent dispatch for the remaining uncached files — do not attempt another
extract_corpus_parallelcall, even with reduced concurrency. - Worth noting in the docs generally:
check_semantic_cache/save_semantic_cachekey their cache entries to the extraction prompt fingerprint. The Gemini backend's internal prompt differs fromreferences/extraction-spec.md(used by subagent dispatch), so partial progress made via Gemini is not visible to a subsequent subagent-based run's cache check (0 hits, all files re-treated as uncached). If a provider switch mid-run is a supported recovery path, it might be worth either (a) documenting that a provider switch means starting over on caching, or (b) unifying the cache key so partial progress carries over.