Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 21 additions & 2 deletions acceptance/acceptance_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -202,15 +202,34 @@ func testAccept(t *testing.T, inprocessMode bool, singleTest string) int {
// pick up the host's agent. Setting these to "" via test.toml is not
// enough: the SDK (since v0.132.0) treats empty values as a truthy
// signal because os.LookupEnv reports them as present.
for _, v := range []string{
// Keep this list in sync with the SDK's useragent.listKnownAgents.
knownAgents := []string{
Comment on lines +205 to +206
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

"AMP_CURRENT_THREAD_ID",
"ANTIGRAVITY_AGENT",
"AUGMENT_AGENT",
"CLAUDECODE",
"CLINE_ACTIVE",
"CODEX_CI",
"COPILOT_CLI",
"CURSOR_AGENT",
"GEMINI_CLI",
"GOOSE_TERMINAL",
"KIRO",
"OPENCLAW_SHELL",
"OPENCODE",
} {
"VSCODE_AGENT",
"WINDSURF_AGENT",
}

// AGENT and AI_AGENT are not in listKnownAgents; the SDK consults them as
// a generic fallback (useragent.agentEnvFallback) when none of the
// specific agents above is set.
genericAgents := []string{
"AGENT",
"AI_AGENT",
}

for _, v := range slices.Concat(knownAgents, genericAgents) {
os.Unsetenv(v) //nolint:usetesting // t.Setenv cannot unset
}

Expand Down
Loading