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:
vianhanif
2026-09-03 09:25:06 +07:00
parent acb5c34cdc
commit 15687d1913
2 changed files with 3 additions and 1 deletions

View File

@@ -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);
}