[codex] Expose sync timeout as queryable error#4
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: a1ed49e7a5
ℹ️ 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".
| return data.code === 5004 || | ||
| (data.status === 'processing' && typeof error === 'string' && error.includes('Sync mode timed out')); |
There was a problem hiding this comment.
Require processing status for sync timeout classification
For a sync-mode response such as { status: 'failed', code: 5004 }, this classifies WaveSpeed's generic timeout error code as a still-running sync timeout before checking the task status. That makes run() throw a non-retryable WavespeedSyncTimeoutException and makes runNoThrow() report detail.status === 'processing' even though the task is terminally failed; require status === 'processing' or the sync-timeout message when treating 5004 as queryable.
Useful? React with 👍 / 👎.
What changed
WavespeedSyncTimeoutExceptionand exported it from package entrypoints.maxRetriesis set.run()return shape.processingdetail fromrunNoThrow()withtaskIdandresultUrl.run()andrunNoThrow().Why
A sync timeout means the task is still processing asynchronously. SDK callers need to distinguish that from a failed prediction and must be able to query the task later.
User impact
run(..., { enableSyncMode: true })raisesWavespeedSyncTimeoutExceptionon sync timeout. Callers usingrunNoThrow()can inspectdetail.status === "processing",detail.taskId, anddetail.resultUrl.Validation
npm test -- --runInBandnpm run buildgit diff --check