Skip to content

Commit becdaee

Browse files
committed
fix(openai-responses): retry streamed response.failed encrypted-content errors
The encrypted reasoning replay retry only wrapped client.responses.create() (pre-stream). In practice invalid_encrypted_content / thinking_signature_invalid arrive mid-stream as a response.failed SSE event thrown inside processResponsesStream, which bubbled to the outer transport catch with no retry and surfaced as a hard 'LLM request failed'. Widen the retry to cover create + drain via runResponsesDrainWithEncryptedRetry: on a streamed encrypted-content failure with no committed assistant content, it strips the encrypted payload and re-issues once into the same already-started output/stream (single start/done, no duplicate partial). Also extend isInvalidEncryptedContentError to match nested SDK error shapes (error/cause/response.body) and carry the structured failure code on response.failed throws. Scope is Responses-family only; Anthropic/Google signed-thinking replay is untouched. Adds 7 gate tests covering retry-once, no-retry-after-content, no-op-strip, retry-cap, responseId boundary, single lifecycle, and the nested matcher. Refs #95441
1 parent 514b336 commit becdaee

2 files changed

Lines changed: 564 additions & 91 deletions

File tree

0 commit comments

Comments
 (0)