fix(types): complete responses stream failure contract (#9979)

This commit is contained in:
backryun
2026-08-10 12:28:47 +09:00
committed by GitHub
parent cc3aa05c34
commit 7ad091be11
2 changed files with 4 additions and 2 deletions

View File

@@ -63,6 +63,7 @@ export async function handleResponsesCore({
connectionId,
userAgent: null,
comboName: null,
onStreamFailure: null,
});
// handleChatCore's union includes a bare Response (early returns that never

View File

@@ -367,8 +367,8 @@ test("handleResponsesCore transforms Command Code executor SSE through Responses
assert.match(sse, /data: \[DONE\]/);
});
test("handleResponsesCore propagates upstream failures from chatCore unchanged", async () => {
const { result } = await invokeResponsesCore({
test("handleResponsesCore propagates upstream failures without retrying", async () => {
const { result, calls } = await invokeResponsesCore({
body: {
model: "gpt-4o-mini",
input: "hello",
@@ -382,6 +382,7 @@ test("handleResponsesCore propagates upstream failures from chatCore unchanged",
assert.equal(result.success, false);
assert.equal(result.status, 401);
assert.equal(calls.length, 1);
const payload = (await result.response.json()) as ErrorPayload;
assert.equal(payload.error.message, "[401]: unauthorized");