Commit 410853a
authored
Bump Go SDK to v0.126.0, remove redundant agent tracking (#4799)
## Why
The Go SDK now includes built-in AI agent detection (PR
databricks/databricks-sdk-go#1537). It appends `agent/<name>` to the
User-Agent header when running inside a known agent environment. The CLI
had its own agent-to-UA wiring that did the same thing, which would now
produce duplicate `agent/` segments.
## Changes
**Before:** The CLI detected agents via `libs/agent` and injected
`agent/<name>` into the UA string in `PersistentPreRunE`. The SDK had no
agent detection.
**Now:** The SDK handles agent detection natively. The CLI's redundant
wiring is removed.
Specific changes:
- Bump Go SDK from v0.120.0 to v0.126.0
- Delete `cmd/root/user_agent_agent.go` (the `withAgentInUserAgent`
function)
- Delete `libs/agent/` package (dead code after removal)
- Remove `agent.Detect(ctx)` from `Execute()` in root.go
- Add HTTP-level tests verifying the SDK produces exactly one `agent/`
segment
- Update auth prompt logic: use `cfg.HostType()` instead of
`ErrNotAccountClient`/`ErrNotWorkspaceClient` (the SDK removed host-type
validation from client constructors in favor of host metadata
resolution). Synthesize sentinel errors when prompting is unavailable to
preserve `MustAnyClient` fallthrough behavior.
- Add `.well-known/databricks-config` handler to the default test
server, so acceptance tests with custom profiles don't produce
non-deterministic host metadata warnings
- Update `auth/switch/nominal` test to point profiles at the mock server
instead of fake DNS hostnames
- Add `.well-known/databricks-config` handlers to labs test mock servers
- Regenerated code from `make generate` with updated OpenAPI SHA
## Test plan
- [x] `TestSDKAgentDetection`: exactly one `agent/claude-code` in UA
header
- [x] `TestSDKNoAgentDetected`: no `agent/` when no agent env vars set
- [x] `TestSDKMultipleAgentsSuppressed`: no `agent/` when multiple
agents detected
- [x] `TestAccountClientOrPrompt` and `TestWorkspaceClientOrPrompt` pass
- [x] `TestAccountClientOrPromptReturnsErrorForWrongHostType`: wrong
host type with prompting disabled returns `ErrNotAccountClient`
- [x] `TestWorkspaceClientOrPromptReturnsErrorForWrongHostType`: wrong
host type with prompting disabled returns `ErrNotWorkspaceClient`
- [x] `TestAccountClientOrPromptReturnsErrorForMissingAccountID`:
missing account ID with prompting disabled returns `ErrNotAccountClient`
- [x] `cmd/labs/project` tests pass
- [x] `experimental/aitools` tests pass
- [x] `make checks` passes
- [x] Acceptance tests (refschema, account-help, auth/switch/nominal)
pass
- [x] `make generate` on final commit produces no diff
This pull request was AI-assisted by Isaac.1 parent 6b6d637 commit 410853a
File tree
114 files changed
+2448
-390
lines changed- .codegen
- .github
- acceptance
- apps/deploy
- bundle-with-appname
- no-bundle-with-appname
- auth
- bundle_and_profile
- credentials
- basic
- oauth
- pat
- unified-host
- bin
- bundle
- refschema
- resource_deps/bad_ref_string_to_int
- resources/volumes/change-schema-name
- run
- inline-script/databricks-cli
- profile-is-passed/from_flag
- target-is-passed
- default
- from_flag
- scripts/databricks-cli
- profile-is-passed/from_flag
- target-is-passed
- default
- from_flag
- telemetry
- templates/telemetry
- custom-template
- dbt-sql
- default-python
- default-sql
- user_agent
- simple
- variables/host
- cmd
- auth
- describe/default-profile
- profiles
- switch/nominal
- workspace/apps
- help
- selftest
- record_cloud
- basic
- error
- pipeline-crud
- volume-io
- workspace-file-io
- server
- telemetry
- failure
- partial-success
- skipped
- success
- timeout
- workspace
- jobs
- create-error
- create
- lakeview/publish
- repos
- create_with_provider
- create_without_provider
- delete_by_path
- get_errors
- update
- bundle
- internal
- schema
- validation/generated
- schema
- cmd
- labs/project
- root
- workspace
- data-classification
- environments
- feature-engineering
- genie
- postgres
- serving-endpoints
- warehouses
- libs
- agent
- testserver
- python/databricks/bundles
- jobs
- _models
- pipelines
- _models
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
114 files changed
+2448
-390
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
90 | 90 | | |
91 | 91 | | |
92 | 92 | | |
| 93 | + | |
93 | 94 | | |
94 | 95 | | |
95 | 96 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
1 | 5 | | |
2 | 6 | | |
3 | 7 | | |
| |||
Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
1 | 5 | | |
2 | 6 | | |
3 | 7 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| 16 | + | |
16 | 17 | | |
17 | 18 | | |
18 | 19 | | |
| |||
72 | 73 | | |
73 | 74 | | |
74 | 75 | | |
| 76 | + | |
75 | 77 | | |
76 | 78 | | |
77 | 79 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
12 | 16 | | |
13 | 17 | | |
14 | 18 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
1 | 10 | | |
2 | 11 | | |
3 | 12 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
1 | 10 | | |
2 | 11 | | |
3 | 12 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
1 | 10 | | |
2 | 11 | | |
3 | 12 | | |
| |||
0 commit comments