You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I prepared a tested fix for transient Codex WebSocket failures being surfaced as terminal PI_AI_ERROR turns instead of entering the default retry policy.
The repository currently exposes no Pull Requests endpoint for external contributors (the REST endpoint returns 404 and the GraphQL repository reports zero PRs), so I am sharing the ready-to-cherry-pick branch here:
pi-ai flattens WebSocket failures to message text before dsh-llm-pi-ai sees them. The current classifier's standalone socket pattern does not match the compound word WebSocket, so messages such as WebSocket error and WebSocket closed 1012 fall through to PI_AI_ERROR.
The default retry policy includes TRANSPORT, but not the catch-all PI_AI_ERROR. A transient provider/network interruption therefore ends the whole turn instead of being retried.
Fix
map generic and transient WebSocket failures to TRANSPORT
map deterministic WebSocket close codes 1002/1003/1007/1008/1009/1010 to INVALID_REQUEST, avoiding retries of protocol, payload, policy, size, and extension failures
leave WebSocket transport is not available in this runtime unclassified and non-retryable
add regression cases for the observed WebSocket error and WebSocket closed 1012 messages
update the English/Chinese package documentation and existing Agent Note
Validation
focused convert.spec.ts: 81/81 tests, 100% coverage for src/stream.ts
pnpm run doc-sync
pnpm run lint
pre-push incremental typecheck
The commit is based on upstream master at b150a551b8d465e31e418e1b2eaf5e79bbb7d28e.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
I prepared a tested fix for transient Codex WebSocket failures being surfaced as terminal
PI_AI_ERRORturns instead of entering the default retry policy.The repository currently exposes no Pull Requests endpoint for external contributors (the REST endpoint returns 404 and the GraphQL repository reports zero PRs), so I am sharing the ready-to-cherry-pick branch here:
Problem
pi-ai flattens WebSocket failures to message text before
dsh-llm-pi-aisees them. The current classifier's standalonesocketpattern does not match the compound wordWebSocket, so messages such asWebSocket errorandWebSocket closed 1012fall through toPI_AI_ERROR.The default retry policy includes
TRANSPORT, but not the catch-allPI_AI_ERROR. A transient provider/network interruption therefore ends the whole turn instead of being retried.Fix
TRANSPORTINVALID_REQUEST, avoiding retries of protocol, payload, policy, size, and extension failuresWebSocket transport is not available in this runtimeunclassified and non-retryableWebSocket errorandWebSocket closed 1012messagesValidation
convert.spec.ts: 81/81 tests, 100% coverage forsrc/stream.tspnpm run doc-syncpnpm run lintThe commit is based on upstream
masteratb150a551b8d465e31e418e1b2eaf5e79bbb7d28e.All reactions