mirror of
https://github.com/openai/codex.git
synced 2026-10-20 08:19:50 +00:00
## Why Sessions can share an analytics client while using different product SKUs. Analytics requests need per-thread attribution to reflect each session's configuration. ## What changed - Register each thread's `apps_mcp_product_sku` and send `X-OpenAI-Product-Sku` on analytics requests grouped by product, without changing authentication. - Send product groups concurrently while preserving event order within each group. - Flush buffered tool events before changing or evicting their product attribution, and clear attribution when a session disables analytics. - Bound retained thread registrations and concurrent product groups. Drop attribution when registration cannot be queued or a batch exceeds the product-group limit. ## Testing Add tests for shared-session attribution, clearing attribution on resume with analytics disabled, buffered events across product changes, queue overflow recovery, registry limits, and concurrent delivery with preserved event order. GitOrigin-RevId: 25a98788cd44d4a85f97ee87aadf3a6909607f6a