acceptance: unset all SDK-known AI-agent env vars before tests#5425
Closed
janniklasrose wants to merge 1 commit into
Closed
acceptance: unset all SDK-known AI-agent env vars before tests#5425janniklasrose wants to merge 1 commit into
janniklasrose wants to merge 1 commit into
Conversation
The SDK derives its user-agent from agent-detection env vars and, since v0.132.0, treats even empty values as present, so clearing them via test.toml does not help. The previous list covered only a subset, leaving acceptance output dependent on which agent launched the test runner. Expand it to mirror useragent.listKnownAgents and split the generic AGENT/AI_AGENT fallback vars into their own list. Co-authored-by: Isaac
Collaborator
|
Commit: 33e3d92 |
Contributor
Waiting for approvalBased on git history, these people are best suited to review:
Eligible reviewers: Suggestions based on git history. See OWNERS for ownership rules. |
janniklasrose
commented
Jun 4, 2026
Comment on lines
+205
to
+206
| // Keep this list in sync with the SDK's useragent.listKnownAgents. | ||
| knownAgents := []string{ |
Contributor
Author
There was a problem hiding this comment.
We can consider exporting this from SDK. We can also skip updating knownAgents and limit to the ones we actually use day to day, since AGENT and AI_AGENT are the key change here
Contributor
Author
|
covered by #5436 |
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.
Changes
knownAgentswith SDK'suseragent.listKnownAgentsAGENTandAI_AGENTto env variable to drop during acceptance testWhy
Local test failures when run from agents.
The SDK derives its user-agent from agent-detection env vars and, since v0.132.0, treats even empty values as present, so clearing them via test.toml does not help. The previous list covered only a subset, leaving acceptance output dependent on which agent launched the test runner. Expand it to mirror useragent.listKnownAgents and split the generic AGENT/AI_AGENT fallback vars into their own list.
Tests
Local & CI
Previously, tests were failing with e.g.
Co-authored-by: Isaac