vikingowl adf417b731 fix(research): 429 aware error handling for Pass 1/2
Pass 1 and Pass 2 now detect Mistral web_search rate limits (shared with
the Pass 0 CronJob) and return a proper HTTP 429 with Retry-After: 60
instead of a generic 500 "AI research failed". Pass 2 is enrichment-only,
so rate-limits there fall through with pass1 results intact.

- pkg/ai: new shared IsRateLimit helper + DefaultRetryAfterSeconds=60.
  discovery/service.go drops its local copy and imports the shared one.
- apierror.TooManyRequests now accepts an optional custom message so the
  response body can include "try again in ~60s".
- market/research.go: respondRateLimited helper sets Retry-After,
  downgrades the log line from ERROR to WARN (rate-limits are expected
  state, not a fault), and returns 429 with a structured rate_limited
  code the admin UI can key off of.
2026-04-18 10:33:13 +02:00
2026-02-21 07:10:30 +01:00
2026-04-07 02:53:03 +02:00
Description
No description provided
1.7 MiB
Languages
Go 60.3%
Svelte 20.3%
Dart 11.1%
TypeScript 5%
PLpgSQL 1.1%
Other 2.1%