From 9c2f0a65f05caa443053fa93dd7f052d57474bd7 Mon Sep 17 00:00:00 2001 From: MythEclipse Date: Wed, 17 Jun 2026 04:30:07 +0700 Subject: [PATCH] feat: add request logging to AI proxy routes - Log session ID, model, pool size, and active session count on every POST /v1/chat/completions and POST /v1/messages Co-Authored-By: Claude --- src/index.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/index.ts b/src/index.ts index 891a84d..bf37020 100644 --- a/src/index.ts +++ b/src/index.ts @@ -490,6 +490,7 @@ const server: Server = Bun.serve({ try { const body = await req.json(); const sessionId = crypto.randomUUID(); + console.log(`[index] POST /v1/chat/completions session=${sessionId.slice(0, 8)} model=${(body as any).model} poolSize=${proxyPool.size} sessionPool.active=${sessionPool.activeSessions}`); return handleChatCompletion(body, proxyPool, sessionPool, sessionId); } catch { return new Response( @@ -512,6 +513,7 @@ const server: Server = Bun.serve({ try { const body = await req.json(); const sessionId = crypto.randomUUID(); + console.log(`[index] POST /v1/messages session=${sessionId.slice(0, 8)} model=${(body as any).model} poolSize=${proxyPool.size} sessionPool.active=${sessionPool.activeSessions}`); return handleAnthropicMessages(body, proxyPool, sessionPool, sessionId); } catch { return new Response(