Skip to content

openai-v2: remove unused experimental code and tests - #5263

Open
lmolkova wants to merge 1 commit into
lmolkova/openai-v2-proxy-genai-openaifrom
lmolkova/openai-v2-cleanup
Open

lmolkova wants to merge 1 commit into
lmolkova/openai-v2-proxy-genai-openaifrom
lmolkova/openai-v2-cleanup

Conversation

@lmolkova

@lmolkova lmolkova commented Oct 29, 2026 •

Copy link
Copy Markdown
Member

Removes code that became unused once the built-in latest experimental implementation was turned off in #5260. No functional changes.

  • Deletes the experimental modules (chat stream wrappers, Responses API instrumentation) and their tests and recordings.
  • Removes experimental branches from the remaining tests and drops the now always-False latest_experimental_enabled parameters.

Type of change

  • Code cleanup, no functional changes

Checklist:

See contributing.md for styleguide, changelog guidelines, and more.

  • I am a human and not a bot
  • I have run tox -e precommit
  • I have run tox -e typecheck
  • I have run the relevant tests and linting tox environments

@github-actions github-actions Bot added the gen-ai Related to generative AI label Oct 29, 2026
@opentelemetry-pr-dashboard

opentelemetry-pr-dashboard Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

Pull request dashboard status

Waiting on reviewers · refreshed 2026-10-29 19:08 UTC

Review the latest changes.

Status above doesn't look right?
  • Just replied or pushed? Anything around or after the refresh time above may not be picked up yet — give it a few minutes.
  • Anything look wrong? Report it with what you expected; it helps us improve the dashboard.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues remain for the cleanup of unused experimental OpenAI instrumentation.

No open issues 🎉

What changed in this PR

Removes unused built-in experimental OpenAI instrumentation following #5260’s disablement and #5261’s delegation to opentelemetry-instrumentation-genai-openai. This cleanup is intended to preserve existing runtime behavior.

Changes:

  • Deletes experimental chat stream wrappers, Responses API modules, and associated tests and recordings.
  • Simplifies legacy instrumentation helpers, test assertions, and fixtures by removing experimental-mode branches and parameters.
  • Removes changelog fragments for the deleted implementation.

All paths below are relative to instrumentation-genai/opentelemetry-instrumentation-openai-v2/.

File Description
tests/​test_utils.py Removes experimental helpers and simplifies legacy assertions.
tests/​test_responses.py Deletes obsolete Responses API integration tests.
tests/​test_response_wrappers.py Deletes tests for removed response wrappers.
tests/​test_response_extractors.py Deletes tests for removed response extractors.
tests/​test_request_attributes.py Removes experimental parameters and test case.
tests/​test_embeddings.py Simplifies synchronous embedding assertions.
tests/​test_completion_hook.py Deletes skipped built-in completion-hook tests.
tests/​test_chat_metrics.py Uses legacy metric attributes directly.
tests/​test_async_embeddings.py Simplifies asynchronous embedding assertions.
tests/​conftest.py Consolidates legacy fixtures and removes experimental modes.
tests/​cassettes/​test_responses_stream_wrapper_finalize_idempotent[content_mode0].yaml Deletes finalization recording.
tests/​cassettes/​test_responses_create_with_content_span_unsampled[content_mode0].yaml Deletes unsampled-content recording.
tests/​cassettes/​test_responses_create_with_content_shapes[content_mode0].yaml Deletes message-shape recording.
tests/​cassettes/​test_responses_create_with_all_params[content_mode0].yaml Deletes request-parameter recording.
tests/​cassettes/​test_responses_create_token_usage[content_mode0].yaml Deletes token-usage recording.
tests/​cassettes/​test_responses_create_streaming[content_mode0].yaml Deletes basic streaming recording.
tests/​cassettes/​test_responses_create_streaming_user_exception[content_mode0].yaml Deletes user-exception recording.
tests/​cassettes/​test_responses_create_streaming_iteration[content_mode0].yaml Deletes stream-iteration recording.
tests/​cassettes/​test_responses_create_streaming_delegates_response_attribute[content_mode0].yaml Deletes response-delegation recording.
tests/​cassettes/​test_responses_create_streaming_captures_content[content_mode0].yaml Deletes streaming-content recording.
tests/​cassettes/​test_responses_create_streaming_aggregates_cache_tokens[content_mode0].yaml Deletes streaming cache-token recording.
tests/​cassettes/​test_responses_create_stream_propagation_error[content_mode0].yaml Deletes stream-error recording.
tests/​cassettes/​test_responses_create_stop_reason[content_mode0].yaml Deletes stop-reason recording.
tests/​cassettes/​test_responses_create_reports_reasoning_tokens[content_mode0].yaml Deletes reasoning-token recording.
tests/​cassettes/​test_responses_create_instrumentation_error_swallowed[content_mode0].yaml Deletes instrumentation-error recording.
tests/​cassettes/​test_responses_create_event_only_no_content_in_span.yaml Deletes event-only recording.
tests/​cassettes/​test_responses_create_captures_tool_call_content[content_mode0].yaml Deletes tool-call content recording.
tests/​cassettes/​test_responses_create_captures_content[content_mode0].yaml Deletes content-capture recording.
tests/​cassettes/​test_responses_create_basic[content_mode0].yaml Deletes basic response recording.
tests/​cassettes/​test_responses_create_api_error[content_mode0].yaml Deletes API-error recording.
tests/​cassettes/​test_responses_create_aggregates_cache_tokens[content_mode0].yaml Deletes cache-token recording.
src/​opentelemetry/​instrumentation/​openai_v2/​utils.py Removes experimental attribute branches and unused helpers.
src/​opentelemetry/​instrumentation/​openai_v2/​response_wrappers.py Deletes experimental response stream wrappers.
src/​opentelemetry/​instrumentation/​openai_v2/​response_extractors.py Deletes experimental response extraction logic.
src/​opentelemetry/​instrumentation/​openai_v2/​patch.py Removes experimental flags from wrapper signatures and calls.
src/​opentelemetry/​instrumentation/​openai_v2/​patch_responses.py Deletes built-in Responses API patching.
src/​opentelemetry/​instrumentation/​openai_v2/​chat_wrappers.py Deletes experimental chat stream wrappers.
src/​opentelemetry/​instrumentation/​openai_v2/​__init__.py Updates embedding wrapper calls to simplified signatures.
.changelog/​4554.changed Removes experimental tool-definition changelog fragment.
.changelog/​4500.changed Removes experimental stream-refactor changelog fragment.

Review effort: Balanced

@lmolkova
lmolkova force-pushed the lmolkova/openai-v2-cleanup branch from ad87afb to 0d54ee6 Compare October 29, 2026 18:00
Removes the built-in latest experimental implementation that is no
longer wired up, its tests and recordings, the experimental branches in
the remaining tests, and changelog entries for the removed code. No
functional changes.
@lmolkova
lmolkova force-pushed the lmolkova/openai-v2-cleanup branch from 0d54ee6 to 7c55418 Compare October 29, 2026 18:59
@lmolkova
lmolkova marked this pull request as ready for review October 29, 2026 19:08
@lmolkova
lmolkova requested a review from a team as a code owner October 29, 2026 19:08

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gen-ai Related to generative AI

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

2 participants