0
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2026-08-08 17:53:55 +08:00
discourse/plugins/discourse-ai/spec/serializers
Sam 3d737f966e
FEATURE: retry transient and rate-limited LLM completion requests (#41237)
Adds automatic retries to the completions endpoint base so transient
failures no longer surface immediately to callers. Rate limits (429)
get their own backoff budget honoring Retry-After (capped at 60s),
while 408/409/5xx and network errors (timeouts, connection
resets, SSL errors) share a separate transient budget. Retry waits are
bounded, jittered, and interruptible via the cancel manager so both
synchronous and background completions stay responsive.

Each retried attempt's HTTP status is recorded in the new
AiApiAuditLog#retry_attempt_statuses column (network errors use 0,
which is outside the HTTP range) and exposed via the serializer along
with response_status for visibility into what was retried.

Bedrock Converse is intentionally left on SDK-managed retries to avoid
double-retrying request streams, and now records the failing status
code on the audit log.

Also adds a configurable service_tier param for Gemini (standard, flex,
priority) surfaced through the LLM model config.

---------

Co-authored-by: discourse-patch-triage[bot] <272280883+discourse-patch-triage[bot]@users.noreply.github.com>
2026-06-30 09:45:26 +10:00
..
ai_api_audit_log_serializer_spec.rb FEATURE: retry transient and rate-limited LLM completion requests (#41237) 2026-06-30 09:45:26 +10:00
ai_chat_channel_serializer_spec.rb
ai_features_agent_serializer_spec.rb DEV: AI persona to agent migration (#38319) 2026-03-10 15:59:45 +11:00
ai_usage_serializer_spec.rb
llm_model_serializer_spec.rb
topic_view_serializer_spec.rb SECURITY: Force regeneration for edit-outdated summaries and block stale fallback 2026-03-31 15:12:45 +01:00