Skip to content
Snippets Groups Projects

Fix LLM AI client not returning a HTTP response with 204 responses

Merged Stan Hu requested to merge sh-fix-llm-ai-client-204-response into master

What does this MR do and why?

Previously Llm::AiGateway::Client#request returned nil if the AI Gateway return a 204 No Content response. However, this makes it impossible to discern whether the request was successful or whether the server returned a 5xx error.

This was happening because run_retry_with_exponential_backoff returned nil if the body were blank. To fix this, return the HTTParty response even in this case.

References

None. I discovered this in development.

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Stan Hu

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Stan Hu added 1 commit

    added 1 commit

    • 13a83af3 - Fix LLM AI client not returning a HTTP response with 204 responses

    Compare with previous version

  • A deleted user added backend label

    added backend label

  • Stan Hu removed review request for @mksionek

    removed review request for @mksionek

  • Stan Hu added 1 commit

    added 1 commit

    • 44029c92 - Fix LLM AI client not returning a HTTP response with 204 responses

    Compare with previous version

  • Stan Hu added 1 commit

    added 1 commit

    • 1fb48fb0 - Fix LLM AI client not returning a HTTP response with 204 responses

    Compare with previous version

  • Stan Hu
  • Stan Hu
  • Stan Hu
  • Stan Hu requested review from @mksionek, @dbiryukov, and @maddievn

    requested review from @mksionek, @dbiryukov, and @maddievn

  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Please register or sign in to reply
    Loading