fix(coding-agent): retry OpenAI Responses early EOF

closes #6727
This commit is contained in:
David Brailovsky
2026-07-17 10:55:56 +02:00
parent 019e4ad687
commit b0c2a90e51
4 changed files with 12 additions and 0 deletions
+1
View File
@@ -5,6 +5,7 @@
### Fixed
- Fixed Kimi Coding subscription models to report API-equivalent implied costs when models.dev reports zero pricing.
- Fixed OpenAI Responses early stream endings to be classified as retryable provider errors ([#6727](https://github.com/earendil-works/pi/issues/6727)).
## [0.80.10] - 2026-07-16
+1
View File
@@ -68,6 +68,7 @@ const RETRYABLE_PROVIDER_ERROR_PATTERN = buildProviderErrorPattern([
// (#4433); Bedrock/Smithy can throw an HTTP/2 no-response error (#3594).
"ended without",
"stream ended before message_stop",
"stream ended before a terminal response event",
"http2 request did not get a response",
// Provider-requested retry delay cap failures should flow through the outer
+9
View File
@@ -9,6 +9,7 @@ const bedrockExplicitRetryMessage =
const nvidiaNIMResourceExhaustedMessage = "ResourceExhausted: Worker local total request limit reached (288/48)";
const bunFetchSocketClosedMessage =
"The socket connection was closed unexpectedly. For more information, pass `verbose: true` in the second argument to fetch()";
const openAIResponsesEarlyEofMessage = "OpenAI Responses stream ended before a terminal response event";
describe("provider retry classification", () => {
it("matches explicit provider retry guidance", () => {
@@ -37,6 +38,14 @@ describe("provider retry classification", () => {
).toBe(true);
});
it("matches OpenAI Responses streams that end before terminal events", () => {
expect(
isRetryableAssistantError(
fauxAssistantMessage("", { stopReason: "error", errorMessage: openAIResponsesEarlyEofMessage }),
),
).toBe(true);
});
it("keeps provider limit errors non-retryable", () => {
expect(
isRetryableAssistantError(