The OAuth token shares one rate budget across everything on the subscription
(incl. interactive Claude Code sessions), so citti's translation is almost
always throttled while coding — hence the page staying German. Template now
emits ANTHROPIC_API_KEY from citti/anthropic_api_key when set (its own rate
budget, no contention), else the OAuth token. Only one var is written so an
empty key can't shadow the token.
Two things made Opdater show 'Opdatering fejlede': the refresh ran
synchronously (so a slow, rate-limited translate timed out the browser)
and a 429 returned 502. Now:
- /api/offers/refresh starts the work in a background thread and returns
immediately; the button says 'Opdaterer i baggrunden' and reloads a bit
later as batches land. A lock prevents overlapping runs.
- match_offers_ai skips the Claude call when the offer set is unchanged
since the last successful match (hashed), so it runs ~weekly (when the
avis turns over), not every daily refresh — fewer calls, less cost, less
rate pressure.