Skip to content

[google-genai] Standardize tool-call argument serialization - #791

Open
JacksonWeber wants to merge 4 commits into
open-telemetry:mainfrom
JacksonWeber:issue-764-google-tool-arguments
Open

JacksonWeber wants to merge 4 commits into
open-telemetry:mainfrom
JacksonWeber:issue-764-google-tool-arguments

Conversation

@JacksonWeber

Copy link
Copy Markdown
Contributor

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

  • Breaking change: captured arguments no longer use code.function.parameters.* entries
  • This change requires a documentation update

How has this been tested?

  • Focused tool/function tests: 39 passed on Python 3.10 / oldest dependencies; 64 passed on Python 3.14 / latest pinned dependencies
  • Scoped Ruff, formatting, rstcheck, and README rendering

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

  • Followed the style guidelines of this project
  • Changelog fragment needs renaming from +tool-arguments.changed to the assigned PR number
  • Unit tests added
  • Documentation updated

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>
@opentelemetry-pr-dashboard

opentelemetry-pr-dashboard Bot commented Sep 24, 2026 •

Copy link
Copy Markdown

Pull request dashboard status

Waiting on reviewers · refreshed 2026-09-25 21:54 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.

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.

JacksonWeber and others added 2 commits September 25, 2026 13:29
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

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

Labels

None yet

Development

Successfully merging this pull request may close these issues.

[opentelemetry-instrumentation-google-genai] Standardize tool call argument serialization with other instrumentations

2 participants