Skip to content

[opentelemetry-util-genai] Add tests for tool invocation context property and explicit context - #747

Merged
lmolkova merged 3 commits into
open-telemetry:mainfrom
lmolkova:test/tool-invocation-context
Sep 20, 2026
Merged

lmolkova merged 3 commits into
open-telemetry:mainfrom
lmolkova:test/tool-invocation-context

Conversation

@lmolkova

@lmolkova lmolkova commented Sep 19, 2026

Copy link
Copy Markdown
Member

What does this change do?

Adds unit tests validating ToolInvocation.context, handler.tool(..., context=...), and handler.start_tool(..., context=...).

Why?

Ensures explicit parent context propagation and the active span context property are covered by unit tests, in preparation for codegen (#702).

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.

Copilot review overview

🟡 Changes recommended

Assertions should verify the exact invocation span and full trace context, not only recording status and span ID.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 2 Low severity

Open (2)
What changed in this PR

Adds unit coverage for ToolInvocation.context and explicit parent-context propagation, supporting the utility codegen work in #702.

Changes:

  • Tests the invocation context property.
  • Tests explicit context for tool() and start_tool().
File Description
util/​opentelemetry-util-genai/​tests/​test_toolcall.py Adds context and parent-span propagation tests.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread util/opentelemetry-util-genai/tests/test_toolcall.py Outdated
Comment thread util/opentelemetry-util-genai/tests/test_toolcall.py Outdated
@opentelemetry-pr-dashboard

opentelemetry-pr-dashboard Bot commented Sep 19, 2026

Copy link
Copy Markdown

Pull request dashboard status

Merged · refreshed 2026-09-20 05:05 UTC

Status above doesn't look right?
  • Anything look wrong? Report it with what you expected; it helps us improve the dashboard.

@lmolkova lmolkova added the Skip Changelog PR does not require a changelog entry label Sep 19, 2026
@lmolkova
lmolkova added this pull request to the merge queue Sep 20, 2026
Merged via the queue into open-telemetry:main with commit 452fc3a Sep 20, 2026
75 checks passed
@lmolkova
lmolkova deleted the test/tool-invocation-context branch September 20, 2026 05:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Skip Changelog PR does not require a changelog entry

Development

Successfully merging this pull request may close these issues.

3 participants