Skip to content

fix: clarify ForceEndTurn deployment behavior - #788

Open
GregHolmes wants to merge 4 commits into
mainfrom
gh/fix-force-end-turn-followups
Open

GregHolmes wants to merge 4 commits into
mainfrom
gh/fix-force-end-turn-followups

Conversation

@GregHolmes

Copy link
Copy Markdown
Contributor

Summary

  • State that ForceEndTurn is available on hosted deployments, including EU and AU, while self-hosted availability follows the deployed release.
  • Report FORCE_END_TURN_UNSUPPORTED immediately in the Voice Agent example.
  • Link the frozen EOT description patch to deepgram-docs #1202 and correct the Pydantic v1 unfreeze condition.
  • Restore the socket-client grouping in the generated-patch ledger.

Validation

  • python3 -m compileall on both changed examples
  • git diff --check
  • ruff check in a Python 3.12 container

@github-actions

github-actions Bot commented Sep 14, 2026 •

Copy link
Copy Markdown
Contributor

Code Coverage

Package Line Rate Branch Rate Complexity Health
src.deepgram 97% 94% 0 ✔
src.deepgram.agent 100% 100% 0 ✔
src.deepgram.agent.v1 98% 100% 0 ✔
src.deepgram.agent.v1.settings 100% 100% 0 ✔
src.deepgram.agent.v1.settings.think 100% 100% 0 ✔
src.deepgram.agent.v1.settings.think.models 97% 100% 0 ✔
src.deepgram.auth 100% 100% 0 ✔
src.deepgram.auth.v1 100% 100% 0 ✔
src.deepgram.auth.v1.tokens 97% 100% 0 ✔
src.deepgram.core 88% 81% 0 ➖
src.deepgram.errors 100% 100% 0 ✔
src.deepgram.helpers 98% 92% 0 ✔
src.deepgram.listen 100% 100% 0 ✔
src.deepgram.listen.v1 98% 93% 0 ✔
src.deepgram.listen.v1.media 97% 100% 0 ✔
src.deepgram.listen.v2 98% 93% 0 ✔
src.deepgram.manage 100% 100% 0 ✔
src.deepgram.manage.v1 100% 100% 0 ✔
src.deepgram.manage.v1.models 96% 100% 0 ✔
src.deepgram.manage.v1.projects 97% 100% 0 ✔
src.deepgram.manage.v1.projects.billing 100% 100% 0 ✔
src.deepgram.manage.v1.projects.billing.balances 96% 100% 0 ✔
src.deepgram.manage.v1.projects.billing.breakdown 97% 100% 0 ✔
src.deepgram.manage.v1.projects.billing.fields 97% 100% 0 ✔
src.deepgram.manage.v1.projects.billing.purchases 97% 100% 0 ✔
src.deepgram.manage.v1.projects.keys 96% 100% 0 ✔
src.deepgram.manage.v1.projects.members 97% 100% 0 ✔
src.deepgram.manage.v1.projects.members.invites 96% 100% 0 ✔
src.deepgram.manage.v1.projects.members.scopes 96% 100% 0 ✔
src.deepgram.manage.v1.projects.models 96% 100% 0 ✔
src.deepgram.manage.v1.projects.usage 98% 100% 0 ✔
src.deepgram.manage.v1.projects.usage.breakdown 97% 100% 0 ✔
src.deepgram.manage.v1.projects.usage.fields 97% 100% 0 ✔
src.deepgram.read 100% 100% 0 ✔
src.deepgram.read.v1 100% 100% 0 ✔
src.deepgram.read.v1.text 98% 100% 0 ✔
src.deepgram.self_hosted 100% 100% 0 ✔
src.deepgram.self_hosted.v1 100% 100% 0 ✔
src.deepgram.self_hosted.v1.distribution_credentials 96% 100% 0 ✔
src.deepgram.speak 100% 100% 0 ✔
src.deepgram.speak.v1 98% 97% 0 ✔
src.deepgram.speak.v1.audio 91% 80% 0 ✔
src.deepgram.speak.v2 98% 93% 0 ✔
src.deepgram.speak.v2.audio 100% 100% 0 ✔
src.deepgram.voice_agent 100% 100% 0 ✔
src.deepgram.voice_agent.configurations 95% 100% 0 ✔
src.deepgram.voice_agent.variables 95% 100% 0 ✔
Summary 95% (6538 / 6855) 91% (1438 / 1574) 0 ✔

Scope: hand-maintained SDK logic. Fern-generated data models (types/, requests/), package __init__.py files, version.py, and the unused core/http_sse/ scaffolding are excluded — see .coveragerc. Unscoped whole-package coverage is ~70%.

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

What this PR does
Changes the ForceEndTurn examples and the conversational-STT skill file to say the control is available on Deepgram-hosted deployments including EU and AU (self-hosted depends on the release), makes the Voice Agent example fail fast on FORCE_END_TURN_UNSUPPORTED, and edits the manual-patch ledger.

What I checked

  • Is the availability claim true? Yes: the repo's own tests/manual/listen/v2/force_end_turn/main.py passed all four steps with trigger: manual against api.deepgram.com, api.eu.deepgram.com, and api.au.deepgram.com.
  • Is FORCE_END_TURN_UNSUPPORTED real? Yes, it is the Voice Agent warning for a non-Flux listen provider (deepgram-docs schemas.agent.v1.yml:220), and both Warning and Error carry .code/.description.
  • Gates in Docker: mypy clean, ruff clean on changed files, pytest 1034 passed.

Blocking

  • The AGENTS.md/.fernignore hunk for listen_v2eot_threshold.py and requests/deepgram_listen_provider_v2.py is stale: main's AGENTS.md:85 already says Fern emits that description natively as of the 2026-09-23 regen and the files were unfrozen, so main's .fernignore no longer lists them. The branch is also CONFLICTING. Fix: rebase onto main and drop that hunk entirely; keep only the StrictInt unfreeze-condition change.

Should-fix

  • "Self-hosted availability depends on the deployed release" (examples/16:24-25, SKILL.md:94) omits the switch. deepgram-docs says it needs listen_v2_force_end_turn = true under [features] on the 2026-09-15 release or later. Say that.
  • tests/manual/listen/v2/force_end_turn/main.py:24-27,174 and async.py:8,115 still say "gated per deployment" / "not enabled on this deployment"; align them with the new sentence.

Nit: examples/32:94-104, the trailing rejected-check can raise after agent_finished is set; fine if intended, worth a comment.

@GregHolmes
GregHolmes force-pushed the gh/fix-force-end-turn-followups branch from a46bb3b to 3836a89 Compare October 6, 2026 11:27

@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 two should-fixes and three small cleanups. Everything the PR claims checked out live; these are about the text and the example around it.

What this PR does: ForceEndTurn is a message that lets an app end a speaker's turn right away instead of waiting for Flux to detect it. The examples and manual tests used to call it "gated per deployment." They now say it works on Deepgram-hosted US, EU and AU, and that self-hosted customers need the 2026-09-15 release plus listen_v2 = true and listen_v2_force_end_turn = true under [features]. The Voice Agent example now stops at once on FORCE_END_TURN_UNSUPPORTED instead of timing out after 15 seconds.

What I checked:

  • Hosted availability: I ran tests/manual/listen/v2/force_end_turn/async.py today against api.deepgram.com, api.eu.deepgram.com and api.au.deepgram.com. All three returned EndOfTurn with trigger="manual".
  • Self-hosted claim: release-260915 shipped on 2026-09-15 with Flux Forced End-of-Turn. The flag names match what the self-hosted team gave on 9/4.
  • Voice Agent example: it completes against prod with Flux. With a Nova-3 listener it raises FORCE_END_TURN_UNSUPPORTED after 2 seconds.
  • Tests and lint: the new test passes, ruff is clean, and CI is green on 3.10–3.13.

Please fix:

  1. reference.md:5417 still says "Requires server-side enablement; deployments without the feature reject the message and close the connection," so a hosted developer reads it as "this may not work for me." Replace it with:
    - Available on Deepgram-hosted deployments (including EU and AU). Self-hosted deployments need the 2026-09-15 release or later with the ForceEndTurn feature enabled; unsupported deployments reply UNPARSABLE_CLIENT_MESSAGE and close the connection
  2. Delete the "Link the frozen EOT description patch to deepgram-docs #1202" bullet from the PR description. Nothing in the diff makes that change.
  3. examples/16-transcription-force-end-turn.py:59: the docstring still says "Because ForceEndTurn is gated … point it at a deployment that has the feature." Suggested: "Accepts DEEPGRAM_BASE_URL=wss:// so it can target a regional or self-hosted deployment. Defaults to production."
  4. examples/32-voice-agent-force-end-turn.py:125: raising inside the with block also prints "Connection error: sent 1011 (internal error)" after the real error. Record the failure, leave the with block, then raise.
  5. examples/32-voice-agent-force-end-turn.py:96-97: the new lines add two mypy attr-defined errors because message is typed object. Typing the callback parameter as typing.Any clears them.

Open question (not blocking): the 9/4 thread in #engineering-self-hosted-releases that names the listen_v2_force_end_turn flag also planned to remove it. If a later self-hosted release drops the flag, "2026-09-15 or later with listen_v2_force_end_turn = true" will be wrong for newer releases. Do you know whether that removal has shipped?

This branch has not been deployed

No deployments
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