Remove deprecated methods from util-genai - #823
Conversation
Pull request dashboard statusMerged · refreshed 2026-10-03 00:36 UTC Status above doesn't look right?
|
f414af5 to
60ec0d4
Compare
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Deprecated API remnants, stale compatibility code, and a prohibited Pyright suppression remain unresolved.
Review effort: Balanced
Findings: 2
Open (3)
What changed in this PR
Removes deprecated util-genAI lifecycle APIs and updates affected tests and reviewer guidance.
Changes:
- Removes deprecated
TelemetryHandlerfactories, lifecycle helpers, and utility functions. - Migrates Anthropic and util tests to current factories.
- Updates changelog and repository instructions.
| File | Description |
|---|---|
.github/instructions/instrumentation.instructions.md |
Updates handler construction guidance. |
.github/instructions/util-genai.instructions.md |
Updates invocation factory guidance. |
util/opentelemetry-util-genai/.changelog/823.removed |
Records removed APIs. |
util/opentelemetry-util-genai/src/opentelemetry/util/genai/handler.py |
Removes deprecated handler APIs. |
util/opentelemetry-util-genai/src/opentelemetry/util/genai/utils.py |
Removes deprecated content helpers. |
util/opentelemetry-util-genai/src/opentelemetry/util/genai/_inference_invocation.py |
Adjusts the content-mode import. |
util/opentelemetry-util-genai/tests/test_utils.py |
Removes legacy API tests. |
util/opentelemetry-util-genai/tests/test_toolcall.py |
Uses the current tool factory. |
util/opentelemetry-util-genai/tests/test_handler_workflow.py |
Renames workflow tests. |
util/opentelemetry-util-genai/tests/test_handler_metrics.py |
Renames inference metric tests. |
instrumentation/opentelemetry-instrumentation-genai-anthropic/tests/test_async_wrappers.py |
Migrates to handler.inference(). |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
babd674 to
b0a52b2
Compare
b0a52b2 to
457d9a6
Compare
lmolkova
left a comment
There was a problem hiding this comment.
Thank you! A small comment and we should be good to go
| ) | ||
|
|
||
|
|
||
| def get_telemetry_handler( |
There was a problem hiding this comment.
Removing get_telemetry_handler breaks released packages on import. langchain 1.0b0, 1.1b0, 1.1b1 and openai-agents 1.0b0, 1.1b0 import it at module level and accept any util below 2, so pip will pair them with the next util release.
Could we keep it, still deprecated, for the rest of 1.x? No released package from this repo uses the other removed APIs.
#841 adds a CI check that catches this kind of break.
There was a problem hiding this comment.
Thanks for pointing this out. I have addressed the feedback.
16427ae to
0e0eb21
Compare


Description
Fixes #246
Type of change
Please delete options that are not relevant.
How has this been tested?
Please describe the tests that you ran to verify your changes. Provide
instructions so we can reproduce. List any relevant details for your test
configuration.
Checklist
See CONTRIBUTING.md
for the style guide, changelog guidance, and more.