Skip to content

fix: Preserve caller session_id as upstream_session_id on fallback session creation in AdkApp. - #7244

Open
copybara-service[bot] wants to merge 1 commit into
mainfrom
copybara_1004821692
Open

copybara-service[bot] wants to merge 1 commit into
mainfrom
copybara_1004821692

Conversation

@copybara-service

Copy link
Copy Markdown
Contributor

fix: Preserve caller session_id as upstream_session_id on fallback session creation in AdkApp.

When AdkApp.streaming_agent_run_with_events receives a caller-supplied request.session_id and session_service.get_session does not find an existing session, AdkApp falls back to self._init_session(...) and creates a new session with a server-generated session.id. Populate state_delta["upstream_session_id"] = request.session_id in that fallback branch so custom ADK agents and plugins can correlate logs and telemetry with the caller's originating session ID via session.state["upstream_session_id"].

…ssion creation in AdkApp.

When `AdkApp.streaming_agent_run_with_events` receives a caller-supplied `request.session_id` and `session_service.get_session` does not find an existing session, `AdkApp` falls back to `self._init_session(...)` and creates a new session with a server-generated `session.id`. Populate `state_delta["upstream_session_id"] = request.session_id` in that fallback branch so custom ADK agents and plugins can correlate logs and telemetry with the caller's originating session ID via `session.state["upstream_session_id"]`.

PiperOrigin-RevId: 1004821692
@copybara-service
copybara-service Bot requested a review from a team as a code owner October 23, 2026 21:45
@product-auto-label product-auto-label Bot added size: m Pull request size is medium. api: vertex-ai Issues related to the googleapis/python-aiplatform API. labels Oct 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api: vertex-ai Issues related to the googleapis/python-aiplatform API. google-contributor size: m Pull request size is medium.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant