feat(regen): listen v2 numerals, multilingual Aura-2 voices, and streaming close() fix#522
Merged
Conversation
GregHolmes
requested review from
deepgram-kiley and
dg-coreylweathers
as code owners
July 20, 2026 10:14
Also gitignore .claude/settings.local.json (per-machine Claude Code permissions) so it stays untracked and out of biome's format scope.
GregHolmes
force-pushed
the
gh/sdk-gen-2026-07-20
branch
from
July 21, 2026 13:08
c4debd9 to
10e404c
Compare
…er recursion The generated Socket.close() synchronously re-fires the registered close event handler via handleClose(); a close handler that calls close() again (an idiomatic cleanup pattern) recursed infinitely and threw RangeError: Maximum call stack size exceeded, surfacing as an unhandled promise rejection Node's internal tracker could not format. All 5 streaming sockets were affected (agent.v1, listen.v1, listen.v2, speak.v1, speak.v2). Fix at the wrapper layer (CustomClient.ts, already frozen) instead of freezing the 5 generated Socket.ts files: a shared WeakSet guard makes each WrappedSocket close() no-op on re-entry (one close notification), and connect() re-arms it so reconnects still close. No new frozen files. Regression coverage in tests/unit/socket-close-idempotent.test.ts (exercises the public createConnection path for all 5 services; verified to fail without the guard).
GregHolmes
force-pushed
the
gh/sdk-gen-2026-07-20
branch
from
July 21, 2026 15:09
2ed1fdd to
bf3d1df
Compare
…ck-compat shim) The 2026-07-20 regen removed stt_latency from the LatencyReport schema (deepgram-docs #1006). AgentV1LatencyReport is a server-emitted (read-only) message, so re-adding the optional field by hand has no request/wire impact — it keeps report.stt_latency resolving (to undefined) instead of breaking existing readers at compile time, avoiding a major-version break. Mirrors the Python SDK's read-side shim (deepgram-python-sdk#746). Frozen in .fernignore; regression coverage in tests/unit/latency-report-stt-compat.test.ts (also gated by make typecheck-tests).
dg-coreylweathers
previously approved these changes
Jul 21, 2026
Drop mentions of other Deepgram SDK repos and private issue trackers (deepgram-python-sdk, deepgram-docs) from source and test comments, keeping the shim/design rationale intact.
dg-coreylweathers
approved these changes
Jul 22, 2026
dg-coreylweathers
left a comment
There was a problem hiding this comment.
Approved. Verified locally: recursion bug + wrapper-layer fix (counterfactual: 10/11 tests fail without the guard), voices/numerals additive-only, all manual patches survived regen, comment-only cleanup in adbbae1 changes no logic. Full gate green: build, unit 580/580, wire 139/139, typecheck, lint. Server-contract + cross-SDK-parity confirmed by Greg. Version-file drift (metadata.json 5.6.1 vs version.ts 5.6.0) is inert and self-heals via release-please — noted, not blocking.
GregHolmes
added a commit
that referenced
this pull request
Jul 22, 2026
🤖 I have created a release *beep* *boop* --- ## [5.7.0](v5.6.0...v5.7.0) (2026-07-22) ### Features * **regen:** listen v2 numerals, multilingual Aura-2 voices, and streaming close() fix ([#522](#522)) ([7f0b9e0](7f0b9e0)) ### Bug Fixes * **agent:** re-add deprecated stt_latency to AgentV1LatencyReport (back-compat shim) ([007c7e4](007c7e4)) * **socket:** make streaming close() idempotent to prevent close-handler recursion ([bf3d1df](bf3d1df)) #### What's in this release SDK regeneration for **2026-07-20** (spec `ff8fd2b`). **No breaking changes.** **New API surface (Fern-owned, additive)** - **`listen.v2` `numerals`** — new `numerals` param + `ListenV2Numerals` type. Connection-time only. Verified end-to-end (serializes onto the connect URL; a TTS'd digits phrase transcribes as `5 5 5 1 2 3 4 … 42 … 3rd` with `numerals: true` vs spelled-out with `false`). - **New Aura-2 multilingual TTS voices** — ~40 voices (es / de / nl / fr / it / ja) on `SpeakV1Model` / `AudioGenerateRequestModel`. Additive only. **Bug fix — streaming `close()` recursion (`bf3d1df`)** - The generated `Socket.close()` synchronously re-fires the registered `close` handler via `handleClose()`; a `close` handler that calls `close()` again (idiomatic cleanup) recursed infinitely → `RangeError: Maximum call stack size exceeded`. **All 5 streaming sockets** were affected (agent.v1, listen.v1, listen.v2, speak.v1, speak.v2); pre-existing on `main`. - Fixed at the wrapper layer (`CustomClient.ts`, already frozen) with a shared `WeakSet` guard — no generated files frozen. Regression test drives the public `createConnection` path for all 5 services. **Bug fix — `stt_latency` back-compat shim (`007c7e4`)** - The spec removed `stt_latency` from `AgentV1LatencyReport` (docs #1006). Since it's a server-emitted (read-only) message, `stt_latency?: number` is re-added by hand as a deprecated read-side field (frozen in `.fernignore`): `report.stt_latency` keeps resolving (to `undefined`) instead of breaking existing readers at compile time — no request/wire impact. Mirrors the Python SDK's read-side shim (deepgram-python-sdk#746). - Both shims work around generator output and can be dropped once corrected upstream. #### Validation — all green `make build` ✅ · `make test` ✅ (unit **580/580**, wire **139/139**) · `make typecheck-tests` ✅ · `biome lint` ✅ · `biome format` ✅ · 27/27 non-management examples run clean against the live API. --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
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.
SDK regeneration 2026-07-20
Fern regeneration cycle. Generator input: `.fern/metadata.json` → sdkVersion 5.6.1, originGitCommit `ff8fd2b` (dirty). No breaking changes (see §3).
1. New API surface this regen (Fern-owned)
2. Patch reconciliation — 11 patches re-applied, 0 dropped
The generator reverted every frozen patch this cycle; each was still needed and re-applied verbatim (version held at 5.6.0 — release-please owns the bump). `.fernignore` restored; `.bak` files removed; `pnpm-lock.yaml` reconciled (`ws 8.21.0→8.21.1`). Also gitignored `.claude/settings.local.json` (was tripping `biome format`).
3. Breaking change from spec — mitigated (stays non-breaking)
The spec removed `stt_latency` from `AgentV1LatencyReport`. It's a server-emitted (read-only) message, so `stt_latency?: number` is re-added by hand as a deprecated read-side field (frozen in `.fernignore`): `report.stt_latency` keeps resolving (to `undefined`) instead of breaking existing readers at compile time — no request/wire impact. Regression coverage in `tests/unit/latency-report-stt-compat.test.ts` (also gated by `make typecheck-tests`).
4. Bug fix — streaming close() recursion (`bf3d1df`)
Found while exercising `numerals`. Every generated `Socket.close()` synchronously re-fires the registered `close` handler via `handleClose()`; a `close` handler that calls `close()` again (idiomatic cleanup) recursed infinitely → `RangeError: Maximum call stack size exceeded` (surfaced as an unhandled rejection Node's internal tracker couldn't format). All 5 streaming sockets affected; pre-existing on `main`. Fixed at the wrapper layer (`CustomClient.ts`, already frozen) with a shared WeakSet guard — no generated files frozen. Regression test `tests/unit/socket-close-idempotent.test.ts` drives the public `createConnection` path for all 5 services (verified to fail without the guard).
Validation — all green
`make build` ✅ · `make test` ✅ (unit 580/580, wire 139/139) · `make typecheck-tests` ✅ · `biome lint` ✅ · `biome format` ✅ · 27/27 non-management examples run clean against the live API.