Skip to content

feat(regen): listen V1 reconfiguration and agent custom think-provider messages - #125

Merged
GregHolmes merged 7 commits into
mainfrom
gh/sdk-gen-2026-10-07
Oct 8, 2026
Merged

GregHolmes merged 7 commits into
mainfrom
gh/sdk-gen-2026-10-07

Conversation

@GregHolmes

@GregHolmes GregHolmes commented Oct 7, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • Regenerate the Java SDK with fernapi/fern-java-sdk 4.23.1.
  • Preserve all 23 required compatibility patches and restore their .fernignore entries.
  • Retain generated Listen V1 Configure/Error and Agent custom Think-provider surfaces.
  • Add expanded websocket regression coverage and a runnable Listen V1 reconfiguration example.

Validation

  • ./gradlew spotlessCheck test compileExamples
  • Tier 1 live integration tests passed for Read, Management, Speak REST, and Listen transcription.
  • Temporary live smoke with DEEPGRAM_API_KEY: Listen V1 Configure rejection dispatched as typed ListenV1Error; Agent WebSocket authenticated and received Welcome.

@GregHolmes GregHolmes changed the title chore: SDK regeneration 2026-10-07 feat(regen): Listen V1 reconfiguration and Agent custom Think-provider messages Oct 7, 2026
@GregHolmes GregHolmes changed the title feat(regen): Listen V1 reconfiguration and Agent custom Think-provider messages feat(regen): listen V1 reconfiguration and agent custom think-provider messages Oct 7, 2026

@dg-coreylweathers dg-coreylweathers left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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, because close() 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.java and .fern/metadata.json, while pom.xml, build.gradle and 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: print error.getMessage() / e.getMessage() so a failed run shows why.
  • README: add a short Listen V1 sendConfigure snippet that also registers onErrorMessage.

What I checked

  • Build: spotlessCheck test compileExamples passed in Docker; CI green on Java 11, 17 and 21.
  • Hand patches: all 23 present, no .bak files 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 Error message matches ListenV1Error; code is 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?

@GregHolmes

Copy link
Copy Markdown
Collaborator Author

Addressed Corey's requested changes in 02cf2e8.

  • Listen V1 server Error frames now fall back to onError when no onErrorMessage handler is registered, with regression coverage for that path.
  • Restored the accurate ClientOptions.close() Javadoc and 0.11.0 version consistency.
  • Added the Listen V1 Configure/onErrorMessage README snippet, improved LiveReconfigure diagnostics, and documented both manual patches in AGENTS.md.
  • Restored the metadata trailing newline.

Validation: ./gradlew spotlessCheck test compileExamples.

On Sync: it is absent from the current AsyncAPI and docs, so I left it unmodeled rather than publishing an unverified client message contract. It needs server-team confirmation before adding it to the SDK.

… 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 dg-coreylweathers left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 Error reaches onError when no onErrorMessage handler is registered, with dispatchesServerErrorsToGenericHandlerWithoutTypedHandler covering that path and AGENTS.md recording the patch. S1: the close() Javadoc matches main again and the ClientOptions entry in AGENTS.md names it. S2: 0.11.0 in ClientOptions.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 with onErrorMessage.
  • Gates on the new head? Docker eclipse-temurin:17-jdk: ./gradlew spotlessCheck test compileExamples exit 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 (above sendConfigure) and the LiveReconfigure.java header now say: keep the keyterm list under the 500-token limit, because an over-limit update currently stops transcription without an Error and 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 generated ListenV1Configure Javadoc still says the opposite and is not frozen, so it waits for the deepgram-docs spec correction.
  • New hand-written ListenV1ErrorException (extends DeepgramApiException) carrying the typed ListenV1Error; the Listen V1 fallback now hands this to onError instead of a bare RuntimeException, so generic-handler callers can read variant, description, and code. The message stays "variant: description", with " (code)" appended when the server sends one. Registered as permanently frozen in .fernignore and AGENTS.md. The regression test now asserts the exception type and the carried fields.
  • Gate after the change, Docker eclipse-temurin:17-jdk: spotlessApply made no changes; spotlessCheck test compileExamples exit 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 dg-coreylweathers left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 Error reaches onError when no onErrorMessage handler is registered, with dispatchesServerErrorsToGenericHandlerWithoutTypedHandler covering that path and AGENTS.md recording the patch. S1: the close() Javadoc matches main again and the ClientOptions entry in AGENTS.md names it. S2: 0.11.0 in ClientOptions.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 with onErrorMessage.
  • Gates on the new head? Docker eclipse-temurin:17-jdk: ./gradlew spotlessCheck test compileExamples exit 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 (above sendConfigure) and the LiveReconfigure.java header now say: keep the keyterm list under the 500-token limit, because an over-limit update currently stops transcription without an Error and 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 generated ListenV1Configure Javadoc still says the opposite and is not frozen, so it waits for the deepgram-docs spec correction.
  • New hand-written ListenV1ErrorException (extends DeepgramApiException) carrying the typed ListenV1Error; the Listen V1 fallback now hands this to onError instead of a bare RuntimeException, so generic-handler callers can read variant, description, and code. The message stays "variant: description", with " (code)" appended when the server sends one. Registered as permanently frozen in .fernignore and AGENTS.md. The regression test now asserts the exception type and the carried fields.
  • Gate after the change, Docker eclipse-temurin:17-jdk: spotlessApply made no changes; spotlessCheck test compileExamples exit 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.

@GregHolmes
GregHolmes merged commit ccbe0fd into main Oct 8, 2026
8 checks passed
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.

2 participants