Skip to content

[codex] Expose sync timeout as queryable error#4

Merged
chengzeyi merged 2 commits into
mainfrom
codex/sync-timeout-errors
Jun 16, 2026
Merged

[codex] Expose sync timeout as queryable error#4
chengzeyi merged 2 commits into
mainfrom
codex/sync-timeout-errors

Conversation

@chengzeyi

Copy link
Copy Markdown
Member

What changed

  • Added WavespeedSyncTimeoutException and exported it from package entrypoints.
  • Treat server-side sync timeout as non-retryable to avoid duplicate submissions when maxRetries is set.
  • Preserve successful run() return shape.
  • Return structured processing detail from runNoThrow() with taskId and resultUrl.
  • Updated README/docs and added regression tests for run() and runNoThrow().

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 }) raises WavespeedSyncTimeoutException on sync timeout. Callers using runNoThrow() can inspect detail.status === "processing", detail.taskId, and detail.resultUrl.

Validation

  • npm test -- --runInBand
  • npm run build
  • git diff --check

@claude

claude Bot commented Jun 16, 2026

Copy link
Copy Markdown

Claude encountered an error —— View job


I'll analyze this and get back to you.

@claude

claude Bot commented Jun 16, 2026

Copy link
Copy Markdown

Claude encountered an error —— View job


I'll analyze this and get back to you.

@chengzeyi chengzeyi marked this pull request as ready for review June 16, 2026 17:35
@chengzeyi chengzeyi merged commit b2940bb into main Jun 16, 2026
1 of 2 checks passed
@chengzeyi chengzeyi deleted the codex/sync-timeout-errors branch June 16, 2026 17:35

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread src/api/client.ts
Comment on lines +459 to +460
return data.code === 5004 ||
(data.status === 'processing' && typeof error === 'string' && error.includes('Sync mode timed out'));

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

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.

1 participant