[codex] Handle sync timeout without fallback#7
Conversation
|
Claude encountered an error —— View job I'll analyze this and get back to you. |
|
Claude encountered an error —— View job I'll analyze this and get back to you. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2384fbb608
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| try: | ||
| request_id, sync_result = self._submit( | ||
| model, input, enable_sync_mode=use_sync, timeout=timeout | ||
| model, input, enable_sync_mode=enable_sync_mode, timeout=timeout |
There was a problem hiding this comment.
Stop resubmitting timed-out sync requests
When enable_sync_mode=True and the initial POST ends with an HTTP 504/502 sync timeout, _submit raises a RuntimeError containing HTTP 5, so _is_retryable_error() treats it as task-retryable and this call resubmits the same sync job on every max_retries attempt. That undermines the new no-fallback/no-resubmit behavior for sync timeouts and can create duplicate predictions for users who configure task retries.
Useful? React with 👍 / 👎.
What changed
run()return shape unchanged (outputsonly).max_retriesset.Why
When sync mode times out, the submitted prediction continues processing asynchronously and can be queried later. The SDK should surface that fact instead of silently changing execution mode.
User impact
run(..., enable_sync_mode=True)now raises an actionable error on server-side sync timeout. The error includes the task ID/result URL so users can query the prediction later.Validation
PYTHONPATH=src python -m pytest tests/test_api.pygit diff --check