Repository navigation
feat(regen): listen V1 reconfiguration and agent custom think-provider messages - #125
Conversation
dg-coreylweathers
left a comment
There was a problem hiding this comment.
Requesting changes for one fix; the rest is small.
What this PR does: Regenerates the Java SDK with Fern 4.23.1 and keeps all 23 hand patches. Live transcription (Listen V1) gets sendConfigure(...), which changes keyterms and feature toggles on a running stream without reconnecting, plus a typed onErrorMessage(...) handler for server Error messages. The Voice Agent socket gets custom Think-provider messages in both directions.
Blocking: server errors on Listen V1 now disappear for anyone who registered only onError.
Expected: a server Error message always reaches a handler the developer registered; on main it arrived through onError.
Observed: with no onErrorMessage registered, V1WebSocketClient.java:564-577 parses the message and drops it. The README quickstart and LiveStreaming.java register only onError. I confirmed against production that a malformed Configure returns exactly this kind of Error (SchemaError).
Fix: when errorHandler == null, pass the error to onErrorHandler; add a test for the only-onError case; record the patch in the AGENTS.md entry for this file.
Should-fix
ClientOptions.close()Javadoc (lines 147-150) went back to Fern's wording, "any request issued after this method returns fails with a RejectedExecutionException". That's not true for synchronous calls, becauseclose()only shuts down the dispatcher executor. Please restore main's wording and add it to the AGENTS.md ClientOptions entry.- Version literals are bumped to 0.11.1 in
ClientOptions.javaand.fern/metadata.json, whilepom.xml,build.gradleand the release-please manifest say 0.11.0. Please revert to 0.11.0 and let release-please bump all five files together.
Nits
.fern/metadata.json: restore the trailing newline.LiveReconfigure.java:47,73: printerror.getMessage()/e.getMessage()so a failed run shows why.- README: add a short Listen V1
sendConfiguresnippet that also registersonErrorMessage.
What I checked
- Build:
spotlessCheck test compileExamplespassed in Docker; CI green on Java 11, 17 and 21. - Hand patches: all 23 present, no
.bakfiles left; the query-param patch is intact in all four streaming clients. - Live API: production accepts the example's Configure payload (results, then a normal close). The live
Errormessage matchesListenV1Error;codeis absent, and it's optional in the type. - Compatibility: nothing removed, renamed or made required.
Question: the server's error text lists Sync as an accepted client message (CloseStream, Configure, Sync, KeepAlive, Finalize), but it isn't in the AsyncAPI spec or the SDK. Is it public?
|
Addressed Corey's requested changes in 02cf2e8.
Validation: On |
… and document the keyterm limit Hand the generic onError handler a ListenV1ErrorException that carries the typed ListenV1Error (variant, description, optional code) instead of a bare RuntimeException, register the new hand-written class in .fernignore and AGENTS.md, and note in the README snippet and LiveReconfigure header that an over-limit keyterm update currently stops transcription without an Error.
dg-coreylweathers
left a comment
There was a problem hiding this comment.
Approving. Commit 02cf2e8 addresses every item from the 2026-10-07 review, and I pushed one more commit on top for the keyterm caveat and the generic-handler exception.
What this PR does. Regenerates the Java SDK with Fern 4.23.1. Listen V1 streaming gains sendConfigure(...) for mid-stream Nova-3 keyterm and numerals changes plus a typed onErrorMessage(...) handler, and the Voice Agent socket gains custom Think-provider messages in both directions. All 23 hand patches survive.
What I checked on 02cf2e8.
- Every earlier finding addressed? Yes. B1: a parsed server
ErrorreachesonErrorwhen noonErrorMessagehandler is registered, withdispatchesServerErrorsToGenericHandlerWithoutTypedHandlercovering that path and AGENTS.md recording the patch. S1: theclose()Javadoc matches main again and the ClientOptions entry in AGENTS.md names it. S2: 0.11.0 inClientOptions.java,pom.xml,build.gradle,.fern/metadata.json, and the release-please manifest. N1 to N3: trailing newline,getMessage()in the example, and the README Configure snippet withonErrorMessage. - Gates on the new head? Docker
eclipse-temurin:17-jdk:./gradlew spotlessCheck test compileExamplesexit 0, 159 tests, 0 failures. CI green on Java 11, 17, and 21. Sync: not modeled, and it appears in no spec or public page. Agreed that it waits for server-team confirmation.
What I added in the follow-up commit.
README.md(abovesendConfigure) and theLiveReconfigure.javaheader now say: keep the keyterm list under the 500-token limit, because an over-limit update currently stops transcription without anErrorand the server closes the stream. Verified on production via deepgram-python-sdk #799 (request IDs 01a11601-91c7-7f50-bb58-8f9792fb5b30 and 01a11602-5735-7ce2-a7a2-d34d364a7d15; Linear API-173 still open). The generatedListenV1ConfigureJavadoc still says the opposite and is not frozen, so it waits for the deepgram-docs spec correction.- New hand-written
ListenV1ErrorException(extendsDeepgramApiException) carrying the typedListenV1Error; the Listen V1 fallback now hands this toonErrorinstead of a bareRuntimeException, so generic-handler callers can readvariant,description, andcode. The message stays "variant: description", with " (code)" appended when the server sends one. Registered as permanently frozen in.fernignoreand AGENTS.md. The regression test now asserts the exception type and the carried fields. - Gate after the change, Docker
eclipse-temurin:17-jdk:spotlessApplymade no changes;spotlessCheck test compileExamplesexit 0, 159 tests, 0 failures.
Still open elsewhere. The deepgram-docs AsyncAPI description carries the same over-limit sentence until API-173 ships or a docs correction lands.
dg-coreylweathers
left a comment
There was a problem hiding this comment.
Approving. Commit 02cf2e8 addresses every item from the 2026-10-07 review, and I pushed one more commit on top for the keyterm caveat and the generic-handler exception.
What this PR does. Regenerates the Java SDK with Fern 4.23.1. Listen V1 streaming gains sendConfigure(...) for mid-stream Nova-3 keyterm and numerals changes plus a typed onErrorMessage(...) handler, and the Voice Agent socket gains custom Think-provider messages in both directions. All 23 hand patches survive.
What I checked on 02cf2e8.
- Every earlier finding addressed? Yes. B1: a parsed server
ErrorreachesonErrorwhen noonErrorMessagehandler is registered, withdispatchesServerErrorsToGenericHandlerWithoutTypedHandlercovering that path and AGENTS.md recording the patch. S1: theclose()Javadoc matches main again and the ClientOptions entry in AGENTS.md names it. S2: 0.11.0 inClientOptions.java,pom.xml,build.gradle,.fern/metadata.json, and the release-please manifest. N1 to N3: trailing newline,getMessage()in the example, and the README Configure snippet withonErrorMessage. - Gates on the new head? Docker
eclipse-temurin:17-jdk:./gradlew spotlessCheck test compileExamplesexit 0, 159 tests, 0 failures. CI green on Java 11, 17, and 21. Sync: not modeled, and it appears in no spec or public page. Agreed that it waits for server-team confirmation.
What I added in the follow-up commit.
README.md(abovesendConfigure) and theLiveReconfigure.javaheader now say: keep the keyterm list under the 500-token limit, because an over-limit update currently stops transcription without anErrorand the server closes the stream. Verified on production via deepgram-python-sdk #799 (request IDs 01a11601-91c7-7f50-bb58-8f9792fb5b30 and 01a11602-5735-7ce2-a7a2-d34d364a7d15; Linear API-173 still open). The generatedListenV1ConfigureJavadoc still says the opposite and is not frozen, so it waits for the deepgram-docs spec correction.- New hand-written
ListenV1ErrorException(extendsDeepgramApiException) carrying the typedListenV1Error; the Listen V1 fallback now hands this toonErrorinstead of a bareRuntimeException, so generic-handler callers can readvariant,description, andcode. The message stays "variant: description", with " (code)" appended when the server sends one. Registered as permanently frozen in.fernignoreand AGENTS.md. The regression test now asserts the exception type and the carried fields. - Gate after the change, Docker
eclipse-temurin:17-jdk:spotlessApplymade no changes;spotlessCheck test compileExamplesexit 0, 159 tests, 0 failures.
Still open elsewhere. The deepgram-docs AsyncAPI description carries the same over-limit sentence until API-173 ships or a docs correction lands.
Summary
fernapi/fern-java-sdk4.23.1..fernignoreentries.Validation
./gradlew spotlessCheck test compileExamplesDEEPGRAM_API_KEY: Listen V1 Configure rejection dispatched as typedListenV1Error; Agent WebSocket authenticated and receivedWelcome.