Skip to content

chore(deps/#608): migrate elevenlabs@1.59.0 → @elevenlabs/elevenlabs-js#611

Merged
drewdrewthis merged 4 commits into
mainfrom
fix/608-migrate-elevenlabs-package
Jun 11, 2026
Merged

chore(deps/#608): migrate elevenlabs@1.59.0 → @elevenlabs/elevenlabs-js#611
drewdrewthis merged 4 commits into
mainfrom
fix/608-migrate-elevenlabs-package

Conversation

@drewdrewthis

Copy link
Copy Markdown
Collaborator

Problem

@langwatch/scenario@0.4.12 declares "elevenlabs": "^1.59.0" as a runtime dependency. On npm install @langwatch/scenario, every consumer sees:

npm warn deprecated elevenlabs@1.59.0: This package has moved to @elevenlabs/elevenlabs-js

Changes

javascript/package.json — replaced "elevenlabs": "^1.59.0" with "@elevenlabs/elevenlabs-js": "^2.51.0".

javascript/src/voice/tts/elevenlabs-tts.ts — updated import specifier; renamed model_idmodelId and output_formatoutputFormat in textToSpeech.convert call body (the new Fern-generated SDK uses camelCase; snake_case keys would be silently stripped at runtime).

javascript/src/voice/stt/elevenlabs-stt.ts — updated import specifier; renamed model_idmodelId in speechToText.convert call body (same camelCase requirement).

javascript/pnpm-lock.yaml — lock file updated; old elevenlabs v1 transitive deps dropped.

Python side: no changes — the PyPI elevenlabs package is NOT deprecated (rename is npm-only).

ACs met (from #608)

  • AC1"elevenlabs" removed from dependencies; "@elevenlabs/elevenlabs-js" added ✅
  • AC2 — import specifiers updated in both TS call sites ✅
  • AC3 — TTS + STT request bodies use camelCase field names ✅
  • AC4tsc --noEmit exits 0 with zero new errors ✅ (confirmed by coder agent)
  • AC5 — no elevenlabs deprecation warning on pnpm install ✅ (confirmed by coder agent)

Consumer note

If you import ElevenLabsClient directly from "elevenlabs" in your own code, update that import to "@elevenlabs/elevenlabs-js".

Closes #608

🤖 Generated with Claude Code

…s v2

Replace deprecated `elevenlabs` (^1.59.0) with the canonical
`@elevenlabs/elevenlabs-js` (^2.51.0) SDK. Update all three call sites
to camelCase field names required by the new SDK (modelId, outputFormat).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@drewdrewthis

Copy link
Copy Markdown
Collaborator Author

[grinder] READY for human review

CI: green — zero failing, zero pending

  • ci-checks (24.x) → pass (5m37s)
  • javascript-complete → pass
  • python-complete → pass
  • docs-complete → pass
  • CodeQL (javascript-typescript) → pass
  • CodeQL (python) → pass
  • Validate PR Title → pass
  • evaluate → pass
  • action-semantic-pull-request → pass
  • test, build, firefighting, dismiss-firefighting-approval → SKIPPED (by-design: Python-only files unchanged)

Review threads: zero (GraphQL reviewThreads{"nodes":[]})

Verified by:

Do NOT merge — that's your call.

@drewdrewthis drewdrewthis added pr-ready and removed grinding Grinder is actively managing this PR labels Jun 4, 2026
@drewdrewthis

Copy link
Copy Markdown
Collaborator Author

✅ Review + prove-it: READY

The 1.x→2.x migration is genuine, not a naive find-replace.

Review: v2 API correctly handled — snake_case→camelCase arg keys (model_idmodelId, output_formatoutputFormat), method names/arg order preserved per the installed @elevenlabs/elevenlabs-js@2.51.0 type defs. import { ElevenLabsClient } from "@elevenlabs/elevenlabs-js" resolves; STT speechToText.convert({file, modelId}) and TTS textToSpeech.convert(voiceId, {text, modelId, outputFormat}) match the v2 signatures. Zero from "elevenlabs" refs remain in src/ or examples.

Prove-it (all live):

  • Deprecation warning GONE: grep -i 'deprecated elevenlabs' on a fresh pnpm install → empty. ✅ (the whole point of the migration)
  • tsc: npx tsc --noEmit → exit 0, no elevenlabs errors.
  • 3 live ElevenLabs examples PASS against the migrated v2 SDK:
    • elevenlabs-hosted.test.ts → 8 passed (hosted ConvAI success=true + in-process branded with non-empty STT transcript proving the migrated seam fired)
    • composable-stt-swap.test.ts → 4 passed (EL STT transcribe() calls=4, success=true)
    • src/voice unit suite → 314 passed
      Caveat (non-blocking): stale Wire: JSDoc in elevenlabs-tts.ts:9-10 still shows snake_case while code uses camelCase. Doc lag, zero functional impact.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Merge origin/main (18 commits) into the elevenlabs package migration branch.
package.json auto-merged cleanly: kept main's version bump (0.4.12) and
protobufjs override updates AND the PR's elevenlabs -> @elevenlabs/elevenlabs-js
migration (non-overlapping lines). pnpm-lock.yaml regenerated via pnpm install
(byte-identical to the ort auto-merge). No new old-package imports introduced by main.
Comment thread javascript/src/voice/tts/elevenlabs-tts.ts
Comment thread javascript/package.json
@drewdrewthis

drewdrewthis commented Jun 10, 2026

Copy link
Copy Markdown
Collaborator Author

Review verdict: READY

Re-reviewed by the orchardist (Rule #5) at HEAD 24f19f3a after the author addressed both blocking concerns from the prior verdict (a895334). Both independently re-verified CLOSED:

  • [test] ✅ CLOSED — both convert spies now assert the request body with concrete camelCase values: TTS objectContaining({modelId:"eleven_v3", outputFormat:"pcm_24000"}), STT objectContaining({modelId:"scribe_v1"}). The spy captures the adapter's actual args (regression-proven: wrong-model constants fail the asserts). A model_id regression now fails the test.
  • [proof-reviewer] ✅ CLOSED — AC5 (no deprecation warning) is proven structurally: at HEAD 24f19f3a the deprecated: field and the entire elevenlabs@1.59.0 entry are excised from pnpm-lock.yaml (package.json + importer + packages + snapshots), so the v1 warning physically cannot fire. Corroborated by a fresh non-frozen pnpm install showing zero deprecation lines.

Migration correctness (carried from the prior review): all snake_case→camelCase renames present in both call sites, both imports updated, @elevenlabs/elevenlabs-js@2.51.0 is the official package, leaner transitive tree, no secrets/PII. AC1-AC3 diff-verified; AC4 CI-confirmed (green Type-check). AC1-AC5 all have evidence (5/5).

Non-blocking (not gating)

  • PR body ## ACs met still credits AC4/AC5 to "confirmed by coder agent" — the real proof is the green CI Type-check (AC4) and the lockfile excision + non-frozen install (AC5). Worth updating the body so the proof isn't under-credited, but not gating.

No /prove-it artifact on this PR; AC ticks are author-asserted but all 5 independently hold under review.

…t) + refresh stale doc comment

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@drewdrewthis

Copy link
Copy Markdown
Collaborator Author

AC5 evidence — no elevenlabs deprecation warning on a fresh install (HEAD 24f19f3)

Fresh non-frozen install (rm -rf node_modules && pnpm install) in javascript/:

  • grep -in deprecat <install-log>no matches (zero deprecation lines)
  • The only elevenlabs line in the install output is the migrated scoped package: + @elevenlabs/elevenlabs-js 2.51.0
  • No bare elevenlabs@<version> (old package) entry in the dependency tree; the non-frozen install left pnpm-lock.yaml unchanged (already fully resolved).

This is the reproducible proof that --frozen-lockfile cannot provide (frozen skips re-resolution, so it cannot surface or clear a deprecation notice). AC5 satisfied.

Also addressed in 24f19f3: value-pinned request-body assertions on the EL convert spies (objectContaining({modelId:"eleven_v3",outputFormat:"pcm_24000"}) TTS / ({modelId:"scribe_v1"}) STT — regression-proven: temporarily setting wrong model constants fails both asserts), and the stale elevenlabs@elevenlabs/elevenlabs-js doc comment in elevenlabs-stt.ts.

@drewdrewthis drewdrewthis added the slack-requested Slack PR review request posted label Jun 10, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Automated low-risk assessment

This PR was evaluated against the repository's Low-Risk Pull Requests procedure and does not qualify as low risk.

The PR replaces a runtime dependency (elevenlabs → @elevenlabs/elevenlabs-js) and updates import specifiers and request payload fields used when calling the ElevenLabs SDK. These are changes to a third‑party integration and runtime behavior rather than only UI/docs/tests, so they do not meet the low‑risk criteria. Such integration and dependency changes require a normal review.

This PR requires a manual review before merging.

@drewdrewthis drewdrewthis merged commit 6498df4 into main Jun 11, 2026
21 checks passed
@drewdrewthis drewdrewthis deleted the fix/608-migrate-elevenlabs-package branch June 11, 2026 09:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-ready slack-requested Slack PR review request posted

Projects

None yet

Development

Successfully merging this pull request may close these issues.

chore(deps): migrate deprecated elevenlabs@1.59.0 → @elevenlabs/elevenlabs-js

2 participants