Skip to content

fix(interactions): avoid duplicate User-Agent headers#2313

Open
MukundaKatta wants to merge 3 commits intogoogleapis:mainfrom
MukundaKatta:codex/python-genai-interactions-user-agent
Open

fix(interactions): avoid duplicate User-Agent headers#2313
MukundaKatta wants to merge 3 commits intogoogleapis:mainfrom
MukundaKatta:codex/python-genai-interactions-user-agent

Conversation

@MukundaKatta
Copy link
Copy Markdown

Summary

  • make library version header injection reuse any existing User-Agent key case-insensitively
  • default to a single title-case User-Agent entry when injecting telemetry headers
  • add an interactions regression test that verifies only one user-agent value is emitted

Testing

  • python3 -m py_compile google/genai/_api_client.py google/genai/tests/interactions/test_integration.py
  • python3 -m pytest google/genai/tests/interactions/test_integration.py -k user_agent (fails locally: ModuleNotFoundError: No module named 'google.auth')

@Venkaiahbabuneelam Venkaiahbabuneelam self-assigned this Apr 22, 2026
@Venkaiahbabuneelam Venkaiahbabuneelam added the size:L Code changes between 40-100 lines label Apr 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L Code changes between 40-100 lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants