Fix: suppress affective dialog and proactivity for Gemini 3.x Live models - #820
Open
AmaadMartin wants to merge 2 commits into
Open
Fix: suppress affective dialog and proactivity for Gemini 3.x Live models#820AmaadMartin wants to merge 2 commits into
AmaadMartin wants to merge 2 commits into
Conversation
added 2 commits
August 8, 2026 12:35
Gemini 3.x Live models reject enableAffectiveDialog and proactivity, but BasicLlmRequestProcessor copied both from the run config for every model. Gate the two assignments on the model, matching adk-python basic.py.
…aries liveConnectConfig is a fresh object when the processor runs, so writing undefined clears nothing. The guard leaves both assignments as they were.
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.
Please ensure you have read the contribution guide before creating a pull request.
Link to Issue or Description of Change
N/A
Problem:
BasicLlmRequestProcessorcopiesenableAffectiveDialogandproactivityfrom the run config for every model. Gemini 3.x Live models reject both fields.createRunConfigdefaultsenableAffectiveDialogtofalse, so a caller who configures nothing still sends one of them.Solution: Skip the two assignments when the model is a Gemini 3.x Live model. This mirrors
adk-pythonflows/llm_flows/basic.py, which assignsNoneon the same condition. Python writesNonebecause it clears a pre-existing value; hereliveConnectConfigis a fresh{}(core/src/agents/llm_agent.ts:804) and this processor runs first, so a guard is equivalent. The other fiveliveConnectConfigassignments stay ungated.Parity notes:
adk-jshas nocanonicalLiveModel, so the gate readsllmRequest.model. The processor sets that field fromagent.canonicalModel.modela few lines earlier. This is the fallback branchadk-pythontakes whencanonical_live_modelis absent.isGemini3xFlashLivefromcore/src/utils/model_name.ts. It is narrower thanadk-python's_is_gemini_3_x_live: it requires-flash-liverather than any-live, and it has no Live Translate carve-out. Widening it is separate, already-queued work (fork PR Fix: match adk-python in the Gemini 3.x Live model predicate #715) and is deliberately out of scope here.Collision check:
gh pr list --repo AmaadMartin/adk-js --state open --limit 300. Fork PR #715 (fix/gemini-3x-live-predicate-parity) is the only adjacent PR. It renames and widens the predicate; it touches no file in this diff. This PR branches frommainand imports the namemainhas today. If #715 lands first, this import needs the same one-line rename toisGemini3xLive.Testing Plan
Please describe the tests that you ran to verify your changes. This is required for all PRs that are not small documentation or typo fixes.
Unit Tests:
[x] I have added or updated unit tests for my change.
[x] All unit tests pass locally.
Two new cases in
core/test/agents/processors/basic_llm_request_processor_test.ts. No existing case was edited.gemini-3.1-flash-livedrops both fields, and still receivesresponseModalities, which proves the gate is narrow.gemini-2.5-flashkeeps both fields.Mutation proof, on the exact gated lines:
AssertionError: expected true to be undefined.if (isGemini3xFlashLive(llmRequest.model)). Three tests failed, including the untouchedshould populate liveConnectConfig from runConfig:AssertionError: expected undefined to be true.Coverage of
core/src/agents/processors/basic_llm_request_processor.tsfrom the targeted run: 100% statements, 100% lines, 100% functions, 90.9% branches. The one uncovered branch is line 41,agent.generateContentConfig ?? {}, which this PR does not touch. Both branches of the new guard are covered.Commands run on the pushed commit:
npm run ts:checkreports 4 pre-existing errors in this test file, at lines 98, 174, 195 and 320 onmain. The same 4 errors, at the same sites, remain after this change. This PR adds none.CI note: the first
run-tests (windows-latest)job failed with 3 timeouts intests/integration/app_loaderandtests/integration/build_setup. Those tests runnpm installper fixture and are unrelated to this diff. A rerun of the same commit passed, and Ubuntu and macOS passed on the first attempt.Manual End-to-End (E2E) Tests:
Not run. Observing the field on the wire needs a live WebSocket session against a Gemini 3.x Live model, which needs credentials CI does not have. To check by hand, build an
LlmAgentongemini-3.1-flash-live, run it withRunConfig {enableAffectiveDialog: true, proactivity: {}}, and inspectllmRequest.liveConnectConfigafterBASIC_LLM_REQUEST_PROCESSOR.runAsync.Checklist
[x] I have read the CONTRIBUTING.md document.
[x] I have performed a self-review of my own code.
[x] I have commented my code, particularly in hard-to-understand areas.
[x] I have added tests that prove my fix is effective or that my feature works.
[x] New and existing unit tests pass locally with my changes.