Skip to content

Attribute analytics requests to each thread's product SKU - #49117

Merged
copyberry[bot] merged 1 commit into
mainfrom
copyberry/codex-internal-to-codex-oss/25a98788cd44d4a85f97ee87aadf3a6909607f6a
Sep 29, 2026
Merged

copyberry[bot] merged 1 commit into
mainfrom
copyberry/codex-internal-to-codex-oss/25a98788cd44d4a85f97ee87aadf3a6909607f6a

Conversation

@copyberry

@copyberry copyberry Bot commented Sep 29, 2026 •

Copy link
Copy Markdown

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

  • 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.

## 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
copyberry Bot force-pushed the copyberry/codex-internal-to-codex-oss/25a98788cd44d4a85f97ee87aadf3a6909607f6a branch from da92d5a to 2e6cc4e Compare September 29, 2026 00:49
@github-actions

Copy link
Copy Markdown
Contributor


Thank you for your submission, we really appreciate it. Like many open-source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution. You can sign the CLA by just posting a Pull Request Comment same as the below format.


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
copyberry Bot merged commit 2e6cc4e into main Sep 29, 2026
1 check failed
@copyberry
copyberry Bot deleted the copyberry/codex-internal-to-codex-oss/25a98788cd44d4a85f97ee87aadf3a6909607f6a branch September 29, 2026 00:49
@github-actions github-actions Bot locked and limited conversation to collaborators Sep 29, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant