[google-genai] Standardize tool-call argument serialization - #791
Open
JacksonWeber wants to merge 4 commits into
Open
JacksonWeber wants to merge 4 commits into
JacksonWeber wants to merge 4 commits into
Conversation
Pass call-time bound argument dictionaries to the shared GenAI serializer for sync and async tools, preserving content gating and tool behavior. Assisted-by: GPT-6 Astra Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Assisted-by: GPT-6 Astra Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Pull request dashboard statusWaiting on reviewers · refreshed 2026-09-25 21:54 UTC Review the latest changes. Status above doesn't look right?
|
Contributor
There was a problem hiding this comment.
Copilot review overview
🔵 Needs a closer look
Address the two moderate serialization and cancellation issues before approval.
Review effort: Lite
Findings: None
What changed in this PR
Standardizes Google GenAI tool-call argument capture using bound dictionaries and shared serialization.
Changes:
- Snapshots bound arguments before sync and async tool execution.
- Updates tests for serialization, mutation, errors, and capture gating.
- Adds a changelog entry for the format change.
| File | Summary |
|---|---|
instrumentation/opentelemetry-instrumentation-google-genai/tests/utils/test_tool_call_wrapper.py |
Adds coverage for standardized argument behavior. |
instrumentation/opentelemetry-instrumentation-google-genai/src/opentelemetry/instrumentation/google_genai/tool_call_wrapper.py |
Implements argument binding and snapshotting; moderate fixes remain for cancellation handling and object normalization, plus a documentation nit. |
instrumentation/opentelemetry-instrumentation-google-genai/.changelog/+tool-arguments.changed |
Documents the telemetry format change. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Assisted-by: GPT-6 Astra Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Assisted-by: GPT-6 Astra Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Standardizes Google GenAI tool arguments by passing bound parameter dictionaries to the shared GenAI serializer in both sync and async wrappers. Tool results and content-capture gating are unchanged.
This aligns the argument format with other instrumentations. Arguments are snapshotted before execution; variadic arguments are grouped by parameter name, and omitted defaults are not added.
Fixes #764.
Type of change
code.function.parameters.*entriesHow has this been tested?
Full tox gates were attempted but dependency setup failed with PyPI TLS handshake errors. A pre-existing Pyright error remains in the unchanged tool-dictionary handling.
Checklist
+tool-arguments.changedto the assigned PR number