fix(chat,docker): return 503 for rate-limited providers and bundle node-machine-id
- chat: always return 503 Service Unavailable when all credentials are rate-limited - Dockerfile: explicitly copy node-machine-id into standalone runtime image
This commit is contained in:
@@ -237,7 +237,7 @@ async function handleSingleModelChat(body, modelStr, clientRawRequest = null, re
|
||||
if (!credentials || credentials.allRateLimited) {
|
||||
if (credentials?.allRateLimited) {
|
||||
const errorMsg = lastError || credentials.lastError || "Unavailable";
|
||||
const status = lastStatus || Number(credentials.lastErrorCode) || HTTP_STATUS.SERVICE_UNAVAILABLE;
|
||||
const status = HTTP_STATUS.SERVICE_UNAVAILABLE;
|
||||
log.warn("CHAT", `[${provider}/${model}] ${errorMsg} (${credentials.retryAfterHuman})`);
|
||||
return unavailableResponse(status, `[${provider}/${model}] ${errorMsg}`, credentials.retryAfter, credentials.retryAfterHuman);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user