chore: SDK regeneration 2026-07-09#73
Open
GregHolmes wants to merge 8 commits into
Open
Conversation
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).
b5d52ad to
e1c0ab8
Compare
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
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)
resources/speak/v2/websocket/client (V2WebSocketClient,V2ConnectOptions) +SpeakV2*message types andSpeakV2Encoding/SampleRate/Tag/MipOptOut.AgentV1UpdateListen,AgentV1ListenUpdated,AgentV1UpdateListenListen, plusV1WebSocketClientupdates.DeepgramListenProviderV2expanded.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);
.fernignorerestored to original paths;.bakfiles deleted:core/ClientOptions.java— correct SDK header constants +// x-release-please-versionmarkers; kept0.6.0(release-please owns versioning), not Fern's0.6.1.core/ReconnectingWebSocketListener.java—maxRetries(0)"connect once, don't retry" semantics, configurableconnectionTimeoutMs, and theapplyOptionsOverride(...)hook (required by the frozencore/transport/TransportWebSocketFactory).listen/v2/types/ListenV2CloseStream.java—hashCode()to match generator'sequals().Review fixes
1. Fields-less
equals()/hashCode()contract bug (generator). The generator emitsequals()(all-instances-equal) but nohashCode()for fields-less message types. Fixed + froze all 11 affected types (hashCode() { return getClass().hashCode(); }):ListenV2CloseStream,SpeakV2Close,SpeakV2Flush, and the 8AgentV1*event types. Stopgap — durable fix is upstream in Fern.2.
ReconnectingWebSocketListenerreconnect-options torn read (ours).applyOptionsOverriderewired five separatevolatilefields whilegetNextDelay()read three; a concurrent override could produce an inconsistent (min, growFactor, max) set. Now held behind a singlevolatile ReconnectOptionsreference so reads snapshot a consistent set.3.
TimeoutExceptionmessage unbalanced paren (generator). The retry branch produced(retry attempt #1with no closing paren. Fixed locally; also flagged upstream since the generator emits it.Known, deferred
V2WebSocketClienttimeoutExecutordead field — generator artifact in unfrozen generated code; left for the upstream Fern request rather than freezing another file..fern/metadata.jsonsdkVersion: 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 (allhashCodefreezes now documented).Verification
./gradlew test compileExamples— BUILD SUCCESSFUL.Tests & examples added
RegenTypesTest— newFieldsLessMessageContractcase asserts theequals/hashCodecontract for all 10 newly-patched fields-less types (previously onlyListenV2CloseStreamwas guarded), so a future regen dropping ahashCode()is caught.examples/speak/StreamingTtsV2.java— exercises the new Speak v2 WebSocket client (V2ConnectOptionsconnect,sendSpeak/sendFlush/sendClose, v2 handlers), mirroring the v1 example; gives the new feature a reference and compile-coverage viacompileExamples.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 onDEEPGRAM_SPEAK_V2_WSand 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).