Commit f6fd3af
fix: (regen) route think/models to env.agentRest (#59)
## 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
- [x] Re-apply manual patches after regen.
- [x] Restore `.fernignore` originals; drop `.bak` shadow paths.
- [x] Delete all `.bak` files.
- [x] `./gradlew test compileExamples` validated.
---------
Co-authored-by: fern-api[bot] <115122769+fern-api[bot]@users.noreply.github.com>1 parent fccb3e3 commit f6fd3af
6 files changed
Lines changed: 46 additions & 16 deletions
File tree
- .fern
- src
- main/java/com/deepgram
- core
- resources/agent/v1/settings/think/models
- test/java/com/deepgram
- core
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
| 14 | + | |
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
8 | | - | |
9 | | - | |
10 | | - | |
11 | | - | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
20 | 22 | | |
21 | 23 | | |
22 | 24 | | |
| 25 | + | |
23 | 26 | | |
24 | 27 | | |
25 | 28 | | |
| |||
34 | 37 | | |
35 | 38 | | |
36 | 39 | | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
37 | 44 | | |
38 | 45 | | |
39 | 46 | | |
| |||
45 | 52 | | |
46 | 53 | | |
47 | 54 | | |
| 55 | + | |
| 56 | + | |
48 | 57 | | |
49 | 58 | | |
50 | 59 | | |
| |||
60 | 69 | | |
61 | 70 | | |
62 | 71 | | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
63 | 77 | | |
64 | | - | |
| 78 | + | |
65 | 79 | | |
66 | 80 | | |
67 | 81 | | |
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
45 | | - | |
| 45 | + | |
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
41 | | - | |
| 41 | + | |
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
50 | | - | |
| 50 | + | |
51 | 51 | | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
52 | 59 | | |
53 | 60 | | |
54 | | - | |
| 61 | + | |
55 | 62 | | |
56 | 63 | | |
57 | 64 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
36 | | - | |
| 36 | + | |
37 | 37 | | |
38 | 38 | | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
39 | 48 | | |
40 | 49 | | |
41 | 50 | | |
42 | | - | |
| 51 | + | |
43 | 52 | | |
44 | 53 | | |
45 | 54 | | |
46 | 55 | | |
47 | 56 | | |
48 | | - | |
| 57 | + | |
49 | 58 | | |
50 | 59 | | |
51 | 60 | | |
52 | 61 | | |
53 | 62 | | |
54 | | - | |
| 63 | + | |
55 | 64 | | |
56 | 65 | | |
57 | 66 | | |
| |||
0 commit comments