Attribute analytics requests to each thread's product SKU - #49117
Merged
copyberry[bot] merged 1 commit intoSep 29, 2026
Conversation
## 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
copyberry
Bot
force-pushed
the
copyberry/codex-internal-to-codex-oss/25a98788cd44d4a85f97ee87aadf3a6909607f6a
branch
from
September 29, 2026 00:49
da92d5a to
2e6cc4e
Compare
Contributor
|
I have read the CLA Document and I hereby sign the CLA You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot. |
copyberry
Bot
deleted the
copyberry/codex-internal-to-codex-oss/25a98788cd44d4a85f97ee87aadf3a6909607f6a
branch
September 29, 2026 00:49
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Attribute analytics requests to each thread's product SKU
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
apps_mcp_product_skuand sendX-OpenAI-Product-Skuon analytics requests grouped by product, without changing authentication.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.