Skip to content

Conversation

@roomote
Copy link
Contributor

@roomote roomote bot commented Dec 6, 2025

Summary

This PR attempts to address Issue #9888 by improving error handling and diagnostics for API requests. The changes provide more detailed error information to help debug intermittent "API request failed" errors.

Changes

Enhanced Error Messages

  • Added comprehensive error diagnostics including provider, model, endpoint, and timestamp
  • Improved error messages for both first-chunk failures and mid-stream failures
  • Added request metadata (attempt number, token counts, error codes) to error messages

Better Retry Logic

  • Enhanced retry logic with exponential backoff
  • Added detailed logging for debugging intermittent failures
  • Improved handling of empty assistant responses with auto-retry capability

Request Diagnostics

  • Added diagnostic information for streaming failures including stream position and partial content status
  • Enhanced logging with structured error data for better debugging
  • Added token usage tracking in error diagnostics

Related Issue

Fixes #9888

Testing

  • All existing tests pass (342 test files, 4527 tests passed)
  • No breaking changes to existing functionality
  • Error handling improvements are backward compatible

Feedback Welcome

This PR attempts to address the intermittent API errors reported in the issue. Feedback and guidance are welcome!

- Enhanced error messages to include provider, model, and timestamp information
- Added comprehensive error diagnostics for both first-chunk and mid-stream failures
- Improved retry logic with better error context
- Added request metadata (attempt number, token counts, error codes) to error messages
- Enhanced logging for debugging intermittent API failures

Fixes #9888
@roomote
Copy link
Contributor Author

roomote bot commented Dec 6, 2025

Rooviewer Clock   See task on Roo Cloud

Review complete. No issues found.

This PR adds comprehensive error diagnostics to help debug intermittent API failures. The changes include detailed error context (provider, model, timestamps, token usage, error codes) for streaming failures, empty responses, and first-chunk failures. All 4527 tests pass and the implementation follows existing error handling patterns.

Mention @roomote in a comment to request specific changes to this pull request or fix all unresolved issues.

@hannesrudolph hannesrudolph added the Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. label Dec 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels.

Projects

Status: Triage

Development

Successfully merging this pull request may close these issues.

[BUG] Multiple API Error Request failed after updating to version: 3.36.2

3 participants