diff --git a/NEXT_CHANGELOG.md b/NEXT_CHANGELOG.md index c1d2c483c..a774c1991 100644 --- a/NEXT_CHANGELOG.md +++ b/NEXT_CHANGELOG.md @@ -6,6 +6,7 @@ * Added automatic detection of AI coding agents (Amp, Antigravity, Augment, Claude Code, Cline, Codex, Copilot CLI, Copilot VS Code, Cursor, Gemini CLI, Goose, Kiro, OpenClaw, OpenCode, Windsurf) in the user-agent string. The SDK now appends `agent/` to HTTP request headers when running inside a known AI agent environment. Also honors the `AGENT=` standard: when `AGENT` is set to a known product name the SDK reports that product, and when set to an unrecognized non-empty value the SDK reports `agent/unknown`. Environment variables set to the empty string (e.g. `CLAUDECODE=""`) now count as "set" for presence-only matchers, matching `databricks-sdk-go` semantics; previously they were treated as unset. Explicit agent env vars (e.g. `CLAUDECODE`, `GOOSE_TERMINAL`) always take precedence over the generic `AGENT=` signal. When multiple agent env vars are present (e.g. a Cursor CLI subagent invoked from Claude Code), the user-agent reports `agent/multiple`. ### Bug Fixes +* Add `X-Databricks-Org-Id` header to `SharesExtImpl.list()` for SPOG host compatibility. Without this header, calls to the hand-written extension were rejected by the SPOG proxy with `Unable to load OAuth Config (400 UNKNOWN)`. Mirrors [databricks/databricks-sdk-go#1635](https://github.com/databricks/databricks-sdk-go/pull/1635). ### Security Vulnerabilities diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/sharing/SharesExtImpl.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/sharing/SharesExtImpl.java index a1ab2be87..386f883e9 100644 --- a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/sharing/SharesExtImpl.java +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/sharing/SharesExtImpl.java @@ -19,6 +19,9 @@ public ListSharesResponse list(ListSharesRequest request) { Request req = new Request("GET", path); ApiClient.setQuery(req, request); req.withHeader("Accept", "application/json"); + if (apiClient.workspaceId() != null) { + req.withHeader("X-Databricks-Org-Id", apiClient.workspaceId()); + } return apiClient.execute(req, ListSharesResponse.class); } catch (IOException e) { throw new DatabricksException("IO error: " + e.getMessage(), e);