fix: (regen) route think/models to env.agentRest#59
Open
GregHolmes wants to merge 4 commits into
Open
Conversation
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(...).
lukeocodes
approved these changes
May 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 correctUser-Agent/X-Fern-SDK-Name(com.deepgram:deepgram-java-sdk, version0.4.0) and the// x-release-please-versionmarkers. 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— restoredapplyOptionsOverride(...)runtime hook (used byTransportWebSocketFactoryto applyDeepgramTransportFactory.reconnectOptions()without editing generated WS clients),volatilequalifier on option-derived fields, configurableconnectionTimeoutMsonReconnectOptions(was hardcoded 4000ms), and themaxRetries(0)"connect once, don't retry" semantics (retryCount > maxRetries, not>=).Generator changes worth flagging
Environmentconstructor signature changed from 3-arg to 4-arg with a newagentRestfield, plusgetAgentRestURL()andEnvironment.Builder#agentRest(...).resources/agent/v1/settings/think/models/{Raw,AsyncRaw}ModelsClient.javanow route viaenvironment().getAgentRestURL()instead ofgetAgentURL()..fern/metadata.jsonbumpedsdkVersion: 0.4.1.Environmentchange — intentional fix, not a breakThe regen drops
Environment.AGENTand adds a newagentRestslot toEnvironment(with a 4-arg constructor and corresponding builder method). This is fixing the previously brokenagent.v1.settings.think.models.list()route: the old.AGENTenv routed REST traffic to the wrong host, so any caller of that endpoint was already broken. The newagentRestslot 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.tspatch becauseclient.fetch()passthrough started defaulting toagentRestinstead ofbase. The Java SDK has no equivalent passthrough in the hand-maintainedDeepgramClient/DeepgramClientBuilder, so no analogous patch is needed here.Hand-maintained tests that referenced
Environment.AGENT(EnvironmentTest'sAGENT environmentnested class andClientBuilderTest#testAgentEnvironment) were updated to build an agent-shaped environment viaEnvironment.custom().agentRest(...).Validation
./gradlew test compileExamples→ BUILD SUCCESSFULReconnectingWebSocketListenerTestcovers the re-applied patches:applyOptionsOverride,maxRetries(0)initial-attempt allowance,connectionTimeoutMsconfigurability — all green.bakfiles deleted;.fernignorepaths restored to originals for both still-patched filesTest plan
.fernignoreoriginals; drop.bakshadow paths..bakfiles../gradlew test compileExamplesvalidated.