mirror of
https://github.com/router-for-me/CLIProxyAPI.git
synced 2026-09-06 16:15:50 +08:00
* feat(executor): measure effective TTFT with protocol-aware token classification - Introduce protocol-aware streaming token classification under internal/runtime/executor/helps - Implement responses_ttft_helpers.go for OpenAI Responses / Codex WebSocket & SSE streaming - Filter out container metadata, rate limits, handshake headers, and tool execution outputs - Implement dual-track firstPacketDuration fallback for abnormal / zero-token stream terminations - Add TrackHTTPClientRoundTripOnly to bypass false TTFT triggers on first response body reads - Optimize UsageReporter.ObserveTokenEvent hot path with fast-path RLock short-circuiting (0 B/op) - Align terminal event completions across SSE, WebSocket streaming, and non-streaming executions - Add EnsurePublished metric recording fallback for successful terminal turns lacking usage blocks - Add stub helpers with comprehensive specifications for Chat, Claude, and Gemini protocols * fix(executor): normalize SSE response.done and terminate incomplete WS streams * fix(usage): capture first-packet fallback on initial body reads with TrackHTTPClientRoundTripOnly