Surface wikidata misses + default to gemini-flash-lite#19
Merged
Conversation
Two changes to debug + sustain non-US logo discovery. ## Observability Wikidata's "provider miss" was at Debug, hidden in production's info-level logs. After yesterday's deploy of the wikidata layer, prod traces still showed the chain jumping straight from "cache miss" to "LLM provider miss" with no signal whether wikidata was being skipped (no company_name?), failing to find a Q-entity, missing a P154 claim, or 404-ing on the Commons download. Bumping the miss log to Info with the company_name field included makes the cause visible per request. ## Free-tier quota The Gemini free tier is 20 req/day per project on flash-2.5; we exhausted it on the first day of cache misses (shared quota with dividend-portfolio). Switch the default to gemini-2.5-flash-lite which has a 1000-req/day free quota. Wikidata is supposed to cover most named companies anyway, so the LLM layer is mostly long-tail fallback now — flash-lite is plenty. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
After #18 deployed, prod traces still show non-US tickers (REP.MC, DGE.L) jumping straight from "cache miss" → "LLM provider miss". No log line between them — Wikidata's failure path was at Debug level so we can't see whether it's being skipped (missing `company_name`?), failing to find a Q-entity, missing P154, or 404-ing on the Commons download.
Separately, the Gemini free tier exhausted today (20 req/day per project on flash-2.5, shared with dividend-portfolio):
```
"gemini API returned 429: ... Quota exceeded for metric:
generativelanguage.googleapis.com/generate_content_free_tier_requests,
limit: 20, model: gemini-2.5-flash"
```
Changes
Verification
After deploy, the next REP.MC / DGE.L request should produce a log line like:
```
"wikidata provider miss" symbol=DGE.L company_name="Diageo plc" error="..."
```
That tells us exactly which step of the wikidata pipeline is failing in production, and we can act from there.
🤖 Generated with Claude Code