Skip to content

refactor(client): remove two unused OpenLLMetry span helpers - #111

Open
apucacao wants to merge 2 commits into
mainfrom
ag/remove-openllmetry-helpers-clean
Open

apucacao wants to merge 2 commits into
mainfrom
ag/remove-openllmetry-helpers-clean

Conversation

@apucacao

@apucacao apucacao commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

Summary

set_openllmetry_prompt and set_openllmetry_completion have had no callers since the span work moved every handler onto the content layer in content.py. TELEMETRY-CONTRACT.md said to keep them exported for one release and then remove them, and that release has shipped. This deletes them, along with the parity-test code that only existed to skip them, and updates the contract doc to match.

Testing

  • uv run pytest tests/test_cross_handler_parity.py: 87 passed, 11 skipped.
  • ruff check passes on the changed files.
  • Leaving the full suite and mypy to CI.

Matching TypeScript cleanup: launchdarkly/js-ai-sdk#88

Original branch: ag/remove-openllmetry-helpers


Note

Overview
Removes legacy set_openllmetry_prompt and set_openllmetry_completion from the client package after handlers already write prompts, completions, and usage through content.py and set_usage_span_attributes.

The helpers are dropped from utils.py, unexported from launchdarkly_ai_server, and TELEMETRY-CONTRACT.md section 11 now states they must not return. The cross-handler parity test no longer strips “superseded” function bodies before the vocabulary lock scan—that workaround existed only while dead code still lived in utils.py.

Reviewed by Cursor Bugbot for commit 0be21dd. Bugbot is set up for automated code reviews on this repo. Configure here.

…ompletion

Every handler writes conversation content through the content layer in
content.py since the span work, and the token aliases moved to
set_usage_span_attributes. Nothing in the SDK calls these two functions.
They stayed exported for one release so anyone importing them had time
to move; that release has shipped.

The parity test cut their bodies out before scanning for attribute keys,
so the dead writes could not satisfy the lock. With the functions gone,
that step has nothing left to do and goes too.
Section 11 still described both functions as live and called from every
handler, which stopped being true with the span work. It now says they
were removed from both SDKs and names the helpers that replaced them.
@apucacao
apucacao force-pushed the ag/remove-openllmetry-helpers-clean branch from 5f5775d to 0be21dd Compare September 25, 2026 15:16
@apucacao apucacao changed the title refactor(client)!: remove set_openllmetry_prompt and set_openllmetry_completion refactor(client): remove set_openllmetry_prompt and set_openllmetry_completion Sep 25, 2026
@apucacao apucacao changed the title refactor(client): remove set_openllmetry_prompt and set_openllmetry_completion refactor(client): remove two unused OpenLLMetry span helpers Sep 25, 2026
@apucacao

Copy link
Copy Markdown
Contributor Author

bugbot run

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit 0be21dd. Configure here.

@apucacao
apucacao marked this pull request as ready for review September 25, 2026 15:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant