fix: validate session initialization events (v1) - #6771
Merged
wuliang229 merged 1 commit intoAug 17, 2026
Conversation
Prevent client-supplied session initialization events from seeding ADK runtime state, and tighten HITL confirmation resumption. Session initialization events cannot carry ADK runtime state, and only a call named `adk_request_confirmation` is read as a confirmation request. Backport of commit 3fa71b6 to the v1 release line, where this code lives in `adk_web_server.py` rather than `api_server.py`. Fixes google#5290 Co-authored-by: Petr Marinec <54589756+petrmarinec@users.noreply.github.com>
wuliang229
approved these changes
Aug 17, 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.
Backport of commit 3fa71b6 to the v1 release line, where this code lives in
adk_web_server.pyrather thanapi_server.py.Prevent client-supplied session initialization events from seeding ADK runtime state, and tighten HITL confirmation resumption. Session initialization events cannot carry ADK runtime state, and only a call named
adk_request_confirmationis read as a confirmation request.Fixes #5290
Please ensure you have read the contribution guide before creating a pull request.
Link to Issue or Description of Change
1. Link to an existing issue (if applicable):
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:
test_create_session_accepts_initial_text_eventstest_create_session_accepts_initial_tool_eventstest_create_session_rejects_adk_protocol_callstest_create_session_rejects_long_running_tool_idstest_create_session_rejects_runtime_action_eventstest_resolve_confirmation_targets_requires_adk_namepre-commit(isort, pyink, addlicense) clean.