Skip to content

chore: SDK regeneration 2026-07-09#73

Open
GregHolmes wants to merge 8 commits into
mainfrom
gh/sdk-gen-2026-07-09
Open

chore: SDK regeneration 2026-07-09#73
GregHolmes wants to merge 8 commits into
mainfrom
gh/sdk-gen-2026-07-09

Conversation

@GregHolmes

@GregHolmes GregHolmes commented Jul 9, 2026

Copy link
Copy Markdown
Collaborator

Summary

Fern SDK regeneration for 2026-07-09, with manual patches reconciled against the new generator output (dd2d427 SDK regeneration), plus a review pass that fixed a generator contract bug in the new output and two reconnect-listener issues.

Regenerated output (Fern-owned, new features)

  • Speak v2 WebSocket: new resources/speak/v2/websocket/ client (V2WebSocketClient, V2ConnectOptions) + SpeakV2* message types and SpeakV2Encoding/SampleRate/Tag/MipOptOut.
  • Agent update-listen: AgentV1UpdateListen, AgentV1ListenUpdated, AgentV1UpdateListenListen, plus V1WebSocketClient updates.
  • DeepgramListenProviderV2 expanded.

Manual patches reconciled (existing freezes)

All three temporarily-frozen files were reverted to generator defaults by the regen and had their patches re-applied (none obsolete); .fernignore restored to original paths; .bak files deleted:

  • core/ClientOptions.java — correct SDK header constants + // x-release-please-version markers; kept 0.6.0 (release-please owns versioning), not Fern's 0.6.1.
  • core/ReconnectingWebSocketListener.javamaxRetries(0) "connect once, don't retry" semantics, configurable connectionTimeoutMs, and the applyOptionsOverride(...) hook (required by the frozen core/transport/TransportWebSocketFactory).
  • listen/v2/types/ListenV2CloseStream.javahashCode() to match generator's equals().

Review fixes

1. Fields-less equals()/hashCode() contract bug (generator). The generator emits equals() (all-instances-equal) but no hashCode() for fields-less message types. Fixed + froze all 11 affected types (hashCode() { return getClass().hashCode(); }): ListenV2CloseStream, SpeakV2Close, SpeakV2Flush, and the 8 AgentV1* event types. Stopgap — durable fix is upstream in Fern.

2. ReconnectingWebSocketListener reconnect-options torn read (ours). applyOptionsOverride rewired five separate volatile fields while getNextDelay() read three; a concurrent override could produce an inconsistent (min, growFactor, max) set. Now held behind a single volatile ReconnectOptions reference so reads snapshot a consistent set.

3. TimeoutException message unbalanced paren (generator). The retry branch produced (retry attempt #1 with no closing paren. Fixed locally; also flagged upstream since the generator emits it.

Known, deferred

  • V2WebSocketClient timeoutExecutor dead field — generator artifact in unfrozen generated code; left for the upstream Fern request rather than freezing another file.
  • .fern/metadata.json sdkVersion: 0.6.1 — generator-owned; resolves on next release-please bump.

Docs

  • AGENTS.md: genericized the regen branch prefix (<YOUR_INITIALS>/sdk-gen-...) and completed the temporarily-frozen file list (all hashCode freezes now documented).

Verification

./gradlew test compileExamplesBUILD SUCCESSFUL.

Tests & examples added

  • RegenTypesTest — new FieldsLessMessageContract case asserts the equals/hashCode contract for all 10 newly-patched fields-less types (previously only ListenV2CloseStream was guarded), so a future regen dropping a hashCode() is caught.

  • examples/speak/StreamingTtsV2.java — exercises the new Speak v2 WebSocket client (V2ConnectOptions connect, sendSpeak/sendFlush/sendClose, v2 handlers), mirroring the v1 example; gives the new feature a reference and compile-coverage via compileExamples.

  • IntegrationTest — new opt-in Speak v2 WebSocket test (testIntegration_SpeakV2WebSocket, Tier 2) exercising connect → sendSpeak/sendFlush/sendClose → streamed audio, asserting a Flushed message and non-zero audio bytes. The Speak v2 WS endpoint is not yet GA on the production URL, so the test is gated on DEEPGRAM_SPEAK_V2_WS and skipped by default (verified skipped locally) rather than failing the build; enable it in an environment with access (e.g. staging).

Not added (by design): a torn-read unit test for the reconnect snapshot (timing-dependent/flaky), and an agent update-listen example (nice-to-have, no dependency).

fern-api Bot and others added 6 commits July 9, 2026 11:24
The generator emits equals() (all-instances-equal) but no hashCode() for
fields-less message types, violating the Object contract. Add a consistent
hashCode() to all 11 affected types and freeze them in .fernignore. Also
genericize the AGENTS.md branch prefix and complete the temporarily-frozen list.

To be dropped once the generator emits a matching equals/hashCode pair
(upstream Fern request tracked separately).
Finding 6 (ours): applyOptionsOverride rewired five separate volatile fields
while getNextDelay() read three of them, so a concurrent override could yield a
torn (min, growFactor, max) set. Hold the overridable options behind a single
volatile ReconnectOptions reference; readers snapshot it once for a consistent
view. maxEnqueuedMessages stays a separate final field (not overridable).

Finding 5 (generator bug, also flagged upstream): the TimeoutException retry
branch omitted the closing paren ('(retry attempt #1' -> '(retry attempt #1)').
RegenTypesTest now asserts the equals/hashCode contract for all 10 newly
patched fields-less types (previously only ListenV2CloseStream was guarded),
so a future regen that drops a hashCode() again is caught.

Add examples/speak/StreamingTtsV2.java exercising the new Speak v2 WebSocket
client (V2ConnectOptions connect, sendSpeak/sendFlush/sendClose, v2 handlers),
mirroring the existing v1 example. Gives the new feature a reference and
compile-coverage under compileExamples.
Exercises the new Speak v2 WS end-to-end (connect with V2ConnectOptions,
sendSpeak/sendFlush/sendClose, collect streamed audio, assert a Flushed message
and non-zero audio bytes). The endpoint is not yet GA on the production URL, so
the test is gated on DEEPGRAM_SPEAK_V2_WS and skipped by default rather than
failing the build; enable it in an environment with access (e.g. staging).
@GregHolmes GregHolmes force-pushed the gh/sdk-gen-2026-07-09 branch from b5d52ad to e1c0ab8 Compare July 9, 2026 15:55
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.

1 participant