Skip to content

feat(regen): listen v2 numerals, multilingual Aura-2 voices, and streaming close() fix#522

Merged
GregHolmes merged 7 commits into
mainfrom
gh/sdk-gen-2026-07-20
Jul 22, 2026
Merged

feat(regen): listen v2 numerals, multilingual Aura-2 voices, and streaming close() fix#522
GregHolmes merged 7 commits into
mainfrom
gh/sdk-gen-2026-07-20

Conversation

@GregHolmes

@GregHolmes GregHolmes commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

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).

  • Branch off `main`; temporarily-frozen files swapped to `.bak`, `.fernignore` repointed (`023bbad`)
  • Fern generator output landed (`a394677`)
  • Manual patches reconciled against new output (`10e404c`)
  • Streaming close() recursion bug fixed (`bf3d1df`)
  • `stt_latency` removal shimmed to stay non-breaking (`007c7e4`)

1. New API surface this regen (Fern-owned)

  • `listen.v2`: new `numerals` param + `ListenV2Numerals` type — verified end-to-end (serializes to the connect URL; TTS'd numbers phrase transcribes "5 5 5 1 2 3 4 … 42 … 3rd" with `numerals:true` vs spelled-out with `false`). Connection-time only.
  • ~40 new Aura-2 multilingual TTS voices (es/de/nl/fr/it/ja) on `SpeakV1Model` / `AudioGenerateRequestModel`. Additive only.
  • `SpeakV2Request.model` doc comment trimmed (no behavior change).

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).

Both shims (`stt_latency`, close()) work around generator/template output; once the generated output is corrected upstream, these patches can be dropped.

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.

fern-api Bot and others added 2 commits July 20, 2026 10:16
Also gitignore .claude/settings.local.json (per-machine Claude Code
permissions) so it stays untracked and out of biome's format scope.
@GregHolmes
GregHolmes force-pushed the gh/sdk-gen-2026-07-20 branch from c4debd9 to 10e404c Compare July 21, 2026 13:08
…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
GregHolmes force-pushed the gh/sdk-gen-2026-07-20 branch from 2ed1fdd to bf3d1df Compare July 21, 2026 15:09
@GregHolmes GregHolmes changed the title chore: SDK regeneration 2026-07-20 feat(regen): listen v2 numerals, multilingual Aura-2 voices, and streaming close() fix Jul 21, 2026
…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).
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 dg-coreylweathers left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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
GregHolmes merged commit 7f0b9e0 into main Jul 22, 2026
11 of 12 checks passed
@GregHolmes
GregHolmes deleted the gh/sdk-gen-2026-07-20 branch July 22, 2026 13:57
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).
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