fix: (regen) route think/models to env.agent_rest#715
Open
GregHolmes wants to merge 5 commits into
Open
Conversation
4 tasks
lukeocodes
approved these changes
May 15, 2026
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.
Summary
SDK regeneration 2026-05-15. All 20 temporarily frozen files reviewed; all 20 patches re-applied (no patches dropped this cycle — see "near-miss" note below).
Patches re-applied
core/query_encoder.py— bool→lowercase coercion for websocket query strings (7.1.1 fix).tests/wire/test_manage_v1_projects_keys.py— wire test for legacyCreateKeyV1RequestOneParamsalias.speak/v1,listen/v1,listen/v2,agent/v1) — broadexcept Exception(custom transports), optionalmessage=defaults on control sends.agent/v1/socket_client.py— additionally restored_sanitize_numeric_types(float→int sanitizer).listen/v2/socket_client.py— additionally keptsend_configureastyping.Any/raw_sendshim andtyping.Anyin response Union (generator now emitsListenV2Configure/ListenV2ConfigureSuccessbut we don't yet have evidence the new typed models are wire-correct).AgentV1SettingsAgent(...),AgentV1Settings.agentaccepting both wrapper andagent_idstrings, legacymessages=[...]migration,.messagesread-side property, andaudio.output.containerasstr.__init__.pyfiles restoring compat re-exports:CreateKeyV1RequestOne(+Params),AgentV1HistoryContent(+Params),AgentV1HistoryFunctionCalls(+Params),AgentV1SettingsAgentContextMessagesItem*(+Params),AgentV1SettingsAgent[Context]ListenProviderV1/V2/V2LanguageHint(+Params).Generator changes worth flagging
AgentV1SettingsAgentis now a Union alias (Union[AgentV1SettingsAgentContext, str]) in fresh generator output — callable usage would break. We continue to patch back to a class withmodel_validatorfor backward compat.audio_output.containerregenerated asAgentV1SettingsAudioOutputContainerenum; we keepstr.messagesfield removed fromAgentV1SettingsAgentContext(Params); canonical shape iscontext.messages.agent/v1/settings/think/models/raw_client.pyroute now hitsenvironment.agent_rest.DeepgramClientEnvironmentchange — intentional fix, not a breakThe regen drops
DeepgramClientEnvironment.AGENTand adds a requiredagent_restkwarg toDeepgramClientEnvironment.__init__. This is fixing the previously brokenagent.v1.settings.think.models.list()route: the old.AGENTenv routed REST traffic to the wrong host, so any caller of that endpoint was already broken. The newagent_restslot is the dedicated REST host for agent-served endpoints.JS SDK equivalent (deepgram-js-sdk#499 →
56b8ce5) also needed asrc/Client.tspatch becauseclient.fetch()passthrough started defaulting toagentRestinstead ofbase. The Python SDK has no equivalent passthrough in the hand-maintainedclient.py, so no analogous patch is needed here.Near miss
Initial review classified
agent/v1/types/agent_v1settings.pyandagent/v1/requests/agent_v1settings.pyas droppable (new generator declaresagent: AgentV1SettingsAgentand the newAgentV1SettingsAgentis itselfUnion[AgentV1SettingsAgentContext, str], structurally equivalent). Pytest caught the issue: because we patchAgentV1SettingsAgentback to a class (for callable backward compat), the bareagent: AgentV1SettingsAgentfield rejects string values. Both patches restored to broaden toUnion[AgentV1SettingsAgent, AgentV1SettingsAgentContext, str].tests/custom/test_compat_aliases.pycovers this regression.Validation
uv run pytest -q→ 199 passed, 4 skippeduv run mypy src→ clean (801 files)uv run ruff check src tests→ 57 errors, all pre-existing on main intests/manual/(untouched by regen)Test plan
.fernignoreoriginals; drop.bakshadow paths..bakfiles.pytest,ruff check,mypyvalidated (with caveats above).