Files
multica/server/internal/integrations
LiaoyuanNing@TTC 51e4afc480 MUL-4753 Fix Lark recent context fetch degradation (#5401)
* Fix Lark recent context fetch degradation

* fix(lark): don't retry doomed recent-context fetches

Two retry-policy corrections on the recent-context degradation path:

- Skip the retry when the shared enrichment context is already done.
  Both attempts reuse one ctx capped by EnrichTimeout (~2s), so a
  first-attempt deadline can never recover -- retrying just burns a
  doomed call. Guard the retry on ctx.Err().
- Stop treating rate limits (230020 / HTTP 429) as retryable. The client
  drops Retry-After, so an immediate second call re-hits the limit and
  doubles list load on an already-throttled tenant; degrade instead.

Tests: replace the misleading DeadlineExceeded "recovers on retry" case
with a transient network error (ctx still valid); add coverage for the
done-context no-retry guard, rate-limit no-retry, and the production
plain-wrapped-error classifier path (permission / deleted / token).

Co-authored-by: multica-agent <github@multica.ai>

---------

Co-authored-by: J <j@multica.ai>
Co-authored-by: multica-agent <github@multica.ai>
2026-07-15 13:49:10 +08:00
..