Skip to content

fix: validate session initialization events (v1) - #6771

Merged
wuliang229 merged 1 commit into
google:v1from
jazhang00:fix/validate-session-init-events-v1
Aug 17, 2026
Merged

fix: validate session initialization events (v1)#6771
wuliang229 merged 1 commit into
google:v1from
jazhang00:fix/validate-session-init-events-v1

Conversation

@jazhang00

Copy link
Copy Markdown
Collaborator

Backport of commit 3fa71b6 to the v1 release line, where this code lives in adk_web_server.py rather than api_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_confirmation is 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:

  • I have added or updated unit tests for my change.
    • test_create_session_accepts_initial_text_events
    • test_create_session_accepts_initial_tool_events
    • test_create_session_rejects_adk_protocol_calls
    • test_create_session_rejects_long_running_tool_ids
    • test_create_session_rejects_runtime_action_events
    • test_resolve_confirmation_targets_requires_adk_name
  • All unit tests pass locally.
  • pre-commit (isort, pyink, addlicense) clean.

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
wuliang229 merged commit e7dba7a into google:v1 Aug 17, 2026
14 checks passed
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.

3 participants