mirror of
https://github.com/whit3rabbit/anyllm-proxy.git
synced 2026-09-22 08:00:51 +00:00
Security: strip admin token from browser URL, add cross-origin rejection middleware for admin API, skip tool calls with empty names instead of substituting "unknown". Correctness: use BytesMut for SSE buffering to prevent UTF-8 corruption at TCP chunk boundaries, use saturating_sub for epoch arithmetic, handle CRLF SSE frame delimiters. Runtime: switch runtime_config to std::sync::RwLock (guard is !Send), use block_in_place for SQLite IO, spawn_blocking for tokenization, add tracing reload layer so admin log_level changes apply immediately. Reliability: retry failed log buffer flushes with capped retry queue, add MAX_SSE_BUFFER_SIZE guard in middleware handler, cap tool call and part indices to prevent unbounded vec growth. Observability: defer streaming request logging until stream completes so entries capture actual status, latency, and token counts. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>