Skip to content

Conversation

@zerone0x
Copy link
Contributor

Summary

  • Add isRetryable callback to openaiFailedResponseHandler to mark transient errors as retryable
  • OpenAI's Responses API can return 404 for transient "Item not found" errors
  • Enables automatic retry through the existing SessionProcessor retry mechanism

Retryable status codes: 404, 408, 429, 500, 502, 503, 504

Fixes #10505

Changes

  • packages/opencode/src/provider/sdk/openai-compatible/src/responses/openai-error.ts - Added RETRYABLE_STATUS_CODES set and isRetryable callback

Test plan

  • Verify OpenAI 404 errors are retried automatically
  • Verify other retryable status codes (429, 500, etc.) trigger retry
  • Verify non-retryable errors (400, 401, 403) do not retry

🤖 Generated with Claude Code

OpenAI's Responses API can return 404 for transient errors (e.g., "Item
with id 'msg_xxx' not found"). Add isRetryable callback to mark these
errors as retryable, enabling automatic retry through the existing retry
mechanism in SessionProcessor.

Retryable status codes: 404, 408, 429, 500, 502, 503, 504

Fixes anomalyco#10505

Co-Authored-By: Claude <noreply@anthropic.com>
@github-actions
Copy link
Contributor

The following comment was made by an LLM, it may be inaccurate:

No duplicate PRs found

@tim-smart
Copy link

I tried this change and it does not fix the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

If openai responds with a 404 status, retry the request

2 participants