Skip to content

fix: (regen) route think/models to env.agentRest#59

Open
GregHolmes wants to merge 4 commits into
mainfrom
gh/sdk-gen-2026-05-15
Open

fix: (regen) route think/models to env.agentRest#59
GregHolmes wants to merge 4 commits into
mainfrom
gh/sdk-gen-2026-05-15

Conversation

@GregHolmes
Copy link
Copy Markdown
Contributor

@GregHolmes GregHolmes commented May 15, 2026

Summary

SDK regeneration 2026-05-15. Both temporarily frozen files reviewed; both patches re-applied (no patches dropped this cycle).

Patches re-applied

  • src/main/java/com/deepgram/core/ClientOptions.java — restored correct User-Agent / X-Fern-SDK-Name (com.deepgram:deepgram-java-sdk, version 0.4.0) and the // x-release-please-version markers. Generator regen still rewrites these to the wrong artifact id (com.deepgram:deepgram-sdk / com.deepgram.fern:api-sdk) and strips the markers.
  • src/main/java/com/deepgram/core/ReconnectingWebSocketListener.java — restored applyOptionsOverride(...) runtime hook (used by TransportWebSocketFactory to apply DeepgramTransportFactory.reconnectOptions() without editing generated WS clients), volatile qualifier on option-derived fields, configurable connectionTimeoutMs on ReconnectOptions (was hardcoded 4000ms), and the maxRetries(0) "connect once, don't retry" semantics (retryCount > maxRetries, not >=).

Generator changes worth flagging

  • Environment constructor signature changed from 3-arg to 4-arg with a new agentRest field, plus getAgentRestURL() and Environment.Builder#agentRest(...).
  • resources/agent/v1/settings/think/models/{Raw,AsyncRaw}ModelsClient.java now route via environment().getAgentRestURL() instead of getAgentURL().
  • .fern/metadata.json bumped sdkVersion: 0.4.1.

Environment change — intentional fix, not a break

The regen drops Environment.AGENT and adds a new agentRest slot to Environment (with a 4-arg constructor and corresponding builder method). This is fixing the previously broken agent.v1.settings.think.models.list() route: the old .AGENT env routed REST traffic to the wrong host, so any caller of that endpoint was already broken. The new agentRest slot is the dedicated REST host for agent-served endpoints.

Equivalent fix in Python SDK: deepgram/deepgram-python-sdk#715. JS SDK equivalent (deepgram-js-sdk#499) additionally needed a src/Client.ts patch because client.fetch() passthrough started defaulting to agentRest instead of base. The Java SDK has no equivalent passthrough in the hand-maintained DeepgramClient/DeepgramClientBuilder, so no analogous patch is needed here.

Hand-maintained tests that referenced Environment.AGENT (EnvironmentTest's AGENT environment nested class and ClientBuilderTest#testAgentEnvironment) were updated to build an agent-shaped environment via Environment.custom().agentRest(...).

Validation

  • ./gradlew test compileExamples → BUILD SUCCESSFUL
  • ReconnectingWebSocketListenerTest covers the re-applied patches: applyOptionsOverride, maxRetries(0) initial-attempt allowance, connectionTimeoutMs configurability — all green
  • All .bak files deleted; .fernignore paths restored to originals for both still-patched files

Test plan

  • Re-apply manual patches after regen.
  • Restore .fernignore originals; drop .bak shadow paths.
  • Delete all .bak files.
  • ./gradlew test compileExamples validated.

@GregHolmes GregHolmes requested a review from lukeocodes as a code owner May 15, 2026 16:09
fern-api Bot and others added 2 commits May 15, 2026 16:13
Re-apply patches that Fern's regen reverted, and adapt hand-maintained
tests to the new generator output.

ClientOptions.java: restore correct User-Agent/X-Fern-SDK-* headers
(com.deepgram:deepgram-java-sdk, version 0.4.0) and the
// x-release-please-version markers. Fern regen still rewrites these
to the wrong artifact id and strips the version markers.

ReconnectingWebSocketListener.java: restore applyOptionsOverride()
hook, volatile option-derived fields, configurable connectionTimeoutMs
on ReconnectOptions, and the maxRetries(0) "connect once, don't retry"
semantics (retryCount > maxRetries, not >=). Generator regen still
reverts all of these.

Environment.AGENT was removed by the generator (4-arg constructor with
new agentRest field). Hand-maintained tests that referenced
Environment.AGENT now build an equivalent agent-shaped environment via
Environment.custom().agentRest(...).
@GregHolmes GregHolmes changed the title chore: SDK regeneration 2026-05-15 feat!: (regen) Environment.agentRest split, drop Environment.AGENT May 15, 2026
@GregHolmes GregHolmes changed the title feat!: (regen) Environment.agentRest split, drop Environment.AGENT fix: (regen) route think/models to env.agentRest May 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants