mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-09-14 02:42:24 +03:00
fix(chat-admission): clarify local 503 source (#12223)
This commit is contained in:
@@ -61,7 +61,7 @@ export function structuralRejectionResponse(status: 413 | 503, maxMessages: numb
|
||||
status,
|
||||
historyLimit
|
||||
? `Chat history exceeds the ${maxMessages}-message limit; compact the conversation and retry.`
|
||||
: "Structurally heavy chat request capacity is busy; retry shortly.",
|
||||
: "Local chat admission capacity is busy for this structurally heavy request; upstream provider routing was not attempted. Retry shortly.",
|
||||
undefined,
|
||||
{
|
||||
type: historyLimit ? "payload_too_large" : "server_error",
|
||||
|
||||
@@ -14,7 +14,10 @@ import {
|
||||
} from "../../src/shared/middleware/chatBodyAdmission.ts";
|
||||
|
||||
function heavyBody() {
|
||||
const messages = Array.from({ length: 201 }, (_, i) => ({ role: "user", content: `prompt ${i}` }));
|
||||
const messages = Array.from({ length: 201 }, (_, i) => ({
|
||||
role: "user",
|
||||
content: `prompt ${i}`,
|
||||
}));
|
||||
const tools = Array.from({ length: 32 }, (_, i) => ({
|
||||
type: "function",
|
||||
function: { name: `tool_${i}`, description: "a".repeat(64), parameters: { type: "object" } },
|
||||
@@ -40,7 +43,10 @@ test("#10268: 2nd structurally-heavy agent request is rejected 503 (chat_admissi
|
||||
const res = (second as { admit: false; response: Response }).response;
|
||||
assert.equal(res.status, 503); // client is shown HTTP 503
|
||||
const body = await res.json();
|
||||
assert.equal(body.error?.message, "Structurally heavy chat request capacity is busy; retry shortly.");
|
||||
assert.equal(
|
||||
body.error?.message,
|
||||
"Local chat admission capacity is busy for this structurally heavy request; upstream provider routing was not attempted. Retry shortly."
|
||||
);
|
||||
assert.equal(body.error?.code, "chat_admission_busy");
|
||||
assert.equal(body.error?.reason, "structure_limit");
|
||||
} finally {
|
||||
|
||||
Reference in New Issue
Block a user