Skip to content

Commit 847a2ef

Browse files
authored
acc: unset all SDK v0.141.0 AI-agent env vars before tests (#5436)
The SDK checks 15 explicit env vars and two generic fallbacks (AGENT, AI_AGENT) to detect AI coding agents and add agent/<name> to the User-Agent. The previous list covered only 7 of them, so tests run inside agents like Augment, Copilot, Goose, Kiro, OpenClaw, VS Code agent, or Windsurf would still pick up the host agent and produce non-deterministic output. Add the missing 10 vars and a comment pointing at listKnownAgents() in the SDK so the list is easy to keep in sync on future SDK bumps. Co-authored-by: Isaac
1 parent eba5146 commit 847a2ef

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

acceptance/acceptance_test.go

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,14 +202,27 @@ func testAccept(t *testing.T, inprocessMode bool, singleTest string) int {
202202
// pick up the host's agent. Setting these to "" via test.toml is not
203203
// enough: the SDK (since v0.132.0) treats empty values as a truthy
204204
// signal because os.LookupEnv reports them as present.
205+
// Keep this list in sync with listKnownAgents() in
206+
// github.com/databricks/databricks-sdk-go/useragent/agent.go
207+
// plus the AGENT and AI_AGENT generic fallbacks.
205208
for _, v := range []string{
209+
"AGENT",
210+
"AI_AGENT",
211+
"AMP_CURRENT_THREAD_ID",
206212
"ANTIGRAVITY_AGENT",
213+
"AUGMENT_AGENT",
207214
"CLAUDECODE",
208215
"CLINE_ACTIVE",
209216
"CODEX_CI",
217+
"COPILOT_CLI",
210218
"CURSOR_AGENT",
211219
"GEMINI_CLI",
220+
"GOOSE_TERMINAL",
221+
"KIRO",
222+
"OPENCLAW_SHELL",
212223
"OPENCODE",
224+
"VSCODE_AGENT",
225+
"WINDSURF_AGENT",
213226
} {
214227
os.Unsetenv(v) //nolint:usetesting // t.Setenv cannot unset
215228
}

0 commit comments

Comments
 (0)