Skip to content

acc: unset AI-agent env vars instead of setting them empty#5240

Merged
pietern merged 1 commit into
mainfrom
acceptance-unset-agent-env
May 12, 2026
Merged

acc: unset AI-agent env vars instead of setting them empty#5240
pietern merged 1 commit into
mainfrom
acceptance-unset-agent-env

Conversation

@pietern
Copy link
Copy Markdown
Contributor

@pietern pietern commented May 12, 2026

Move the agent env var scrub from acceptance/test.toml into acceptance_test.go and use os.Unsetenv so the keys are truly absent in child processes.

The old Env.X = "" approach left them present with an empty value; since SDK v0.132 the user-agent detector treats that as a match and stamps agent/multiple onto recorded requests.

This pull request and its description were written by Isaac.

Move the agent env var scrub from acceptance/test.toml into
acceptance_test.go and use os.Unsetenv so the keys are truly absent in
child processes. The old `Env.X = ""` approach left them present with
an empty value; since SDK v0.132 the user-agent detector treats that
as a match and stamps `agent/multiple` onto recorded requests.

Co-authored-by: Isaac
@pietern pietern requested review from denik and simonfaltum May 12, 2026 11:26
@pietern pietern temporarily deployed to test-trigger-is May 12, 2026 11:27 — with GitHub Actions Inactive
@pietern pietern temporarily deployed to test-trigger-is May 12, 2026 11:27 — with GitHub Actions Inactive
@pietern pietern merged commit 7ea4c18 into main May 12, 2026
26 of 28 checks passed
@pietern pietern deleted the acceptance-unset-agent-env branch May 12, 2026 11:38
simonfaltum added a commit that referenced this pull request May 12, 2026
Picks up #5240, which unsets AI-agent env vars in acceptance tests so
the SDK v0.132 user-agent detector stops stamping 'agent/multiple' on
recorded requests.
simonfaltum added a commit that referenced this pull request May 12, 2026
#5240 unsets the AI-agent env vars in acceptance instead of setting
them empty. The SDK v0.132 detector treats empty values as a match, so
recorded requests were stamped with agent/multiple after the SDK bump.
With #5240 merged in, the detector no longer fires; strip the suffix
from all affected goldens. Verified by re-running the affected tests.
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.

3 participants