Skip to content

Evenfire is an intelligence layer platform for running LLM agents that take real actions, on your infrastructure

TypeScript

fix(llm-proxy): answer the runtime rate limiter with JSON rate_limited

Alfredo Lopez87528acc04db
diff --git a/codex-llm-proxy/src/server.ts b/codex-llm-proxy/src/server.ts
index eaa2038db..246bf9846 100644
--- a/codex-llm-proxy/src/server.ts
+++ b/codex-llm-proxy/src/server.ts
@@ -271,6 +271,9 @@ export function createProxyApps(
limit: 60,
standardHeaders: 'draft-7',
legacyHeaders: false,
+ // G1-2 (#720): the Host reads a JSON error code. The library sets
+ // Retry-After and the draft-7 headers before it calls the handler.
+ handler: (_req, res) => reject(res, 429, 'rate_limited'),
})
const adminRateLimit = rateLimit({
windowMs: 60_000,
diff --git a/grok-llm-proxy/src/server.ts b/grok-llm-proxy/src/server.ts
index 939185be5..5413eb91d 100644
--- a/grok-llm-proxy/src/server.ts
+++ b/grok-llm-proxy/src/server.ts
@@ -246,6 +246,9 @@ export function createProxyApps(
limit: 60,
standardHeaders: 'draft-7',
legacyHeaders: false,
+ // G1-2 (#720): the Host reads a JSON error code. The library sets
+ // Retry-After and the draft-7 headers before it calls the handler.
+ handler: (_req, res) => reject(res, 429, 'rate_limited'),
})
const adminRateLimit = rateLimit({
windowMs: 60_000,