mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-08-14 03:02:14 +03:00
fix(types): complete responses stream failure contract (#9979)
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user