Commit Graph

2504 Commits

Author SHA1 Message Date
Wei (Jack) Sun fb77faddea chore(release/candidate): release 1.31.1 (#5422)
Co-authored-by: Sasha Sobran <asobran@google.com>
v1.31.1
2026-04-20 22:01:35 -04:00
Sasha Sobran e283ea04b2 fix: block RCE vulnerability via nested YAML configurations in ADK
Co-authored-by: Sasha Sobran <asobran@google.com>
PiperOrigin-RevId: 902898232
2026-04-21 00:20:12 +00:00
Sasha Sobran 21ebe29c9d fix: bump Vertex SDK version
Co-authored-by: Sasha Sobran <asobran@google.com>
PiperOrigin-RevId: 902757902
2026-04-20 21:47:01 +00:00
Yifan Wang c3dafdbb46 fix: web oauth flow and trace view
Co-authored-by: Yifan Wang <wanyif@google.com>
PiperOrigin-RevId: 902726685
2026-04-20 21:46:59 +00:00
Google Team Member d0afddda4c fix: Disable bound token for mcp_tool
PiperOrigin-RevId: 901509317
2026-04-20 21:46:58 +00:00
Jacksunwei 61cca7e5d6 chore: update last-release-sha for next release v1.31.0 2026-04-17 00:55:07 +00:00
Wei (Jack) Sun b2d81b319c chore(release/candidate): release 1.31.0 (#5360) 2026-04-16 17:54:55 -07:00
Yifan Wang c486504fa2 chore: default to info tab when graph is not available
Co-authored-by: Yifan Wang <wanyif@google.com>
PiperOrigin-RevId: 900943720
2026-04-16 22:41:12 +00:00
George Weale d69477f6ff feat: Add support for memories.ingest_events in VertexAiMemoryBankService
This change introduces `_add_events_to_memory_via_ingest` in `VertexAiMemoryBankService` to support adding events to memory using the `memories.ingest_events` API. This allows passing additional configurations such as `stream_id`, `force_flush`, and `generation_trigger_config`.

This path is triggered when `custom_metadata` contains `use_ingest` or `generation_trigger_config`.

Co-authored-by: George Weale <gweale@google.com>
PiperOrigin-RevId: 900924805
2026-04-16 14:57:35 -07:00
Liang Wu 1af1b4aa26 chore: Remove adk_additional_tools and GetTimezone tool
These are not used in the example

Co-authored-by: Liang Wu <wuliang@google.com>
PiperOrigin-RevId: 900902777
2026-04-16 14:10:26 -07:00
Kathy Wu e12b0af20d fix: Pass in auth headers with header provider instead of connection params
This allows headers to refresh on each request. Also only add auth headers if no auth_scheme or auth_credential is specified

Co-authored-by: Kathy Wu <wukathy@google.com>
PiperOrigin-RevId: 900900323
2026-04-16 14:05:06 -07:00
Yifan Wang 7774a0f961 chore: update adk web to include latest major refactor
Co-authored-by: Yifan Wang <wanyif@google.com>
PiperOrigin-RevId: 900844698
2026-04-16 12:06:00 -07:00
Google Team Member b8e8f6b902 feat: Add "google-adk" user agent to Parameter Manager and Secret Manager clients
Update unit tests to verify the presence and value of the client_info argument during client initialization.

PiperOrigin-RevId: 900448054
2026-04-15 18:52:30 -07:00
Liang Wu bf84e2cee8 feat(live): Add live_session_id to LlmResponse
This change introduces a `live_session_id` field to the `LlmResponse` dataclass and populates it in all responses generated by the `GeminiLlmConnection` when using a Live session. This allows tracking which Live session each response belongs to.

Co-authored-by: Liang Wu <wuliang@google.com>
PiperOrigin-RevId: 900354397
2026-04-15 14:46:06 -07:00
Xiang (Sean) Zhou 5c6f6fe7b6 chore: Add sandbox computer use sample agent
Co-authored-by: Xiang (Sean) Zhou <seanzhougoogle@google.com>
PiperOrigin-RevId: 900322196
2026-04-15 13:38:03 -07:00
Anmol Jaiswal 64ed1a68c9 fix(cli): correct console URL path after adk deploy agent_engine
Merge https://github.com/google/adk-python/pull/5338

### Summary

After deploying an agent with `adk deploy agent_engine`, the generated Google Cloud Console URL uses the outdated path `agent-platform/runtimes`, which no longer resolves to the correct page.

### Changes

**`src/google/adk/cli/cli_deploy.py`**

Updated the URL path in `_print_agent_engine_url` from:
```
https://console.cloud.google.com/agent-platform/runtimes/locations/...
```
to:
```
https://console.cloud.google.com/vertex-ai/agents/agent-engines/locations/...
```

Fixes #5336

COPYBARA_INTEGRATE_REVIEW=https://github.com/google/adk-python/pull/5338 from anmolg1997:fix/deploy-console-url 1fb352e9262e58165eed5eb7b119a655a4860540
PiperOrigin-RevId: 900308294
2026-04-15 13:06:06 -07:00
Xiang (Sean) Zhou 7686848551 feat: Add Vertex AI Agent Engine Sandbox integration for computer use
Implement AgentEngineSandboxComputer, a BaseComputer implementation that
    uses Vertex AI Agent Engine Computer Use Sandbox as a remote browser
    environment. This enables computer-use agents to operate in secure,
    isolated cloud-based browser environments.

    Key features:
    - SandboxClient: Low-level CDP client using vertexai SDK send_command()
    - AgentEngineSandboxComputer: BaseComputer implementation with session
      state management for sandbox sharing across invocations
    - Support for both auto-provisioning and bring-your-own-sandbox (BYOS) modes
    - Automatic token refresh and retry logic for transient navigation errors
    - Fix wait_5_seconds adapter to properly pass tool_context

Co-authored-by: Xiang (Sean) Zhou <seanzhougoogle@google.com>
PiperOrigin-RevId: 900292803
2026-04-15 12:30:44 -07:00
Haiyuan Cao 9ca8c38432 fix: Resolve BigQuery plugin issues with A2A transfers, spans, and metadata
Fixes #5073, #5310, and #5311 with three targeted updates to the `BigQueryAgentAnalyticsPlugin` (no changes to ADK core):
- Classifies `TransferToAgentTool` transfers to `RemoteA2aAgent` as `TRANSFER_A2A` instead of the generic `TRANSFER_AGENT` by resolving the target agent at the call level.
- Ensures a self-consistent BigQuery span tree by preferring the plugin's internal span stack over ambient OTel spans, resolving dangling `parent_span_id` references.
- Surfaces remote A2A interaction metadata (`a2a:request`, `a2a:response`, etc.) in BigQuery by detecting them in custom metadata and logging new `A2A_INTERACTION` events.

Co-authored-by: Haiyuan Cao <haiyuan@google.com>
PiperOrigin-RevId: 900224778
2026-04-15 10:10:54 -07:00
Google Team Member 47fa7b743c docs: update MCP Toolbox branding, binary version, and asset references
## Overview

This PR updates internal tutorials and demonstration guidance following the renaming of the database connectivity tools (`genai-toolbox` -> `mcp-toolbox`) and aligns resource downloads with the newly scoped artifact destinations.

## Changes

* Removed references to legacy `googleapis.github.io/genai-toolbox` pages.
* Updated download commands to pull binaries directly from the rebranded bucket.
* Bumped the embedded curl instruction default payload target to the newly stable `v1.1.0` release tier.

PiperOrigin-RevId: 900207615
2026-04-15 09:34:06 -07:00
Liang Wu d337ddfc3e chore: Update Live sample agents' models
Co-authored-by: Liang Wu <wuliang@google.com>
PiperOrigin-RevId: 899943556
2026-04-14 22:24:19 -07:00
George Weale 454188de5d fix: execute on_event_callback before append_event to persist plugin modifications
Previously, on_event_callback ran after append_event, so plugin
modifications (e.g. custom_metadata) were only visible in the
yielded stream but never persisted to the session store. This
moves the callback before persistence, matching the documented
contract in base_plugin.py.

Fixes #3990

Co-authored-by: George Weale <gweale@google.com>
PiperOrigin-RevId: 899845848
2026-04-14 17:14:05 -07:00
Liang Wu 67dc2ebfd4 refactor(live): Use send_client_content to send conversation history
The `send` method was deprecated.

Co-authored-by: Liang Wu <wuliang@google.com>
PiperOrigin-RevId: 899826160
2026-04-14 16:23:24 -07:00
Ahmad Ragab a4c9387757 fix: make _EvalMetricResultWithInvocation.expected_invocation Optional for conversation_scenario support (#5215)
Co-authored-by: Ankur <ankusharma@google.com>
2026-04-14 16:05:39 -07:00
Kathy Wu 494c360b2a fix: Bump minimum mcp version from 1.23.0 to 1.24.0
We added sampling_capabilities to mcp client session, but it did not exist in mcp versions prior to 1.24.0. Fixes https://github.com/google/adk-python/issues/5058.

Co-authored-by: Kathy Wu <wukathy@google.com>
PiperOrigin-RevId: 899814337
2026-04-14 15:55:22 -07:00
Liang Wu 70c5fc83a6 refactor(live): Use send_tool_response for function responses
The Gemini session now has a dedicated `send_tool_response` method, which is used instead of wrapping function responses in a `LiveClientToolResponse` and calling `send`.

`send` is deprecated.

Co-authored-by: Liang Wu <wuliang@google.com>
PiperOrigin-RevId: 899796634
2026-04-14 15:17:47 -07:00
Sasha Sobran 8bc57283f3 fix: upgrade google-genai lower bound
Co-authored-by: Sasha Sobran <asobran@google.com>
PiperOrigin-RevId: 899626720
2026-04-14 09:27:56 -07:00
Scott Mansfield 1a9df8f774 feat: Firestore support
END_PUBLIC

Merge https://github.com/google/adk-python/pull/5088

Adding support for Firestore for both session and memory storage.

This started by copying the Firestore support from the Java ADK into the Python ADK and also takes inspiration from @anmolg1997's PR https://github.com/google/adk-python-community/pull/104. It does things differently from both.

Firestore contains a hierarchical set of data for sessions:
```
  Hierarchy for sessions:
  adk-session
  ↳ <app name>
    ↳ users
      ↳ <user ID>
        ↳ sessions
          ↳ <session ID>
            ↳ events
              ↳ <event ID>

  Hierarchy for shared App/User state configurations:
  app_states
  ↳ <app name>

  user_states
  ↳ <app name>
    ↳ users
      ↳ <user ID>

  Hierarchy for memory:
  memories
  ↳ <memory ID>
```

The firestore memory service creates a top-level collection that hold indexed memories when sessions are added.

### Link to Issue or Description of Change

This is from an existing customer request for firestore support.

### Testing Plan

**Unit Tests:**

- [x] I have added or updated unit tests for my change.
- [x] All unit tests pass locally.

```
$ pytest tests/unittests/integrations/firestore/
===================================== test session starts ======================================
platform darwin -- Python 3.11.14, pytest-9.0.2, pluggy-1.6.0
rootdir: /Users/scottmansfield/projects/adk-python
configfile: pyproject.toml
plugins: mock-3.15.1, xdist-3.8.0, langsmith-0.7.23, asyncio-1.3.0, anyio-4.13.0
asyncio: mode=Mode.AUTO, debug=False, asyncio_default_fixture_loop_scope=function, asyncio_default_test_loop_scope=function
collected 29 items

tests/unittests/integrations/firestore/test_firestore_memory_service.py .............     [ 44%]
tests/unittests/integrations/firestore/test_firestore_session_service.py ................ [100%]

======================================= warnings summary =======================================
src/google/adk/features/_feature_decorator.py:72
  /Users/scottmansfield/projects/adk-python/src/google/adk/features/_feature_decorator.py:72: UserWarning: [EXPERIMENTAL] feature FeatureName.PLUGGABLE_AUTH is enabled.
    check_feature_enabled()

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
================================ 29 passed, 1 warning in 1.44s =================================
```

**Manual End-to-End (E2E) Tests:**

I created a demo app locally to test the session and memory storage with a real firebase instance. It successfully records sessions and memories, verified by manually checking the cloud console.

Memory did require an index, which will be created by the user the first time the memory session is used. Firestore has a specific deep link that it will create to give the exact index needed. After that, memory worked fine.

### Checklist

- [x] I have read the [CONTRIBUTING.md](https://github.com/google/adk-python/blob/main/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.
- [x] I have manually tested my changes end-to-end.
- [x] Any dependent changes have been merged and published in downstream modules.

COPYBARA_INTEGRATE_REVIEW=https://github.com/google/adk-python/pull/5088 from ScottMansfield:feat/firestore 99efca50e1d5a932fac7b722ebe7e9b4e0eb1ae9
PiperOrigin-RevId: 899328760
2026-04-13 20:50:30 -07:00
Wei (Jack) Sun 5195ba753a chore: merge release v1.30.0 to main
Merge https://github.com/google/adk-python/pull/5313

Syncs version bump and CHANGELOG from release v1.30.0 to main.

COPYBARA_INTEGRATE_REVIEW=https://github.com/google/adk-python/pull/5313 from google:release/v1.30.0 008ca58099
PiperOrigin-RevId: 899245408
2026-04-13 16:46:05 -07:00
Giulio Leone 9b9faa4ba2 fix: populate required fields in FunctionDeclaration json_schema fallback
Merge https://github.com/google/adk-python/pull/5000

Fixes #4798 — `required` fields lost in `FunctionDeclaration` when the `parameters_json_schema` fallback path is used.

Co-authored-by: Xuan Yang <xygoogle@google.com>
COPYBARA_INTEGRATE_REVIEW=https://github.com/google/adk-python/pull/5000 from giulio-leone:fix/required-fields-json-schema-fallback e9783d74f88c2d3a4b0818ab71b9bc8659f5037e
PiperOrigin-RevId: 899243799
2026-04-13 16:41:57 -07:00
Shangjie Chen 80a7ecf4b3 chore(session): refine raw_event storage with safety fixes and fallback test
- Remove outdated TODOs regarding requested_tool_confirmations and native compaction support
- Add a warning log when falling back to legacy storage
- Avoid overwriting valid timestamps from `raw_event` with `None` if the API returns `None`
- Provide a fallback timestamp (current time) to prevent Pydantic validation errors when the API returns no timestamp

Co-authored-by: Shangjie Chen <deanchen@google.com>
PiperOrigin-RevId: 899195056
2026-04-13 14:51:22 -07:00
Google Team Member a64a8e4648 feat: Live avatar support in ADK
Testing plan: Added new unit tests
- `test_avatar_config_initialization`
- `test_avatar_config_with_name`
- `test_receive_video_content`
- `test_streaming_with_avatar_config`

PiperOrigin-RevId: 899193911
2026-04-13 14:48:55 -07:00
George Weale cbcb5e6002 fix: validate user_id and session_id against path traversal
Closes #5110

Co-authored-by: George Weale <gweale@google.com>
PiperOrigin-RevId: 899108631
2026-04-13 11:46:27 -07:00
Kathy Wu f2c68eb153 feat: Add Auth Provider support to agent registry
Co-authored-by: Kathy Wu <wukathy@google.com>
PiperOrigin-RevId: 899104727
2026-04-13 11:39:10 -07:00
Kathy Wu 547766a477 fix: Include a link to the deployed agent
After an agent gets deployed to agent engine, include a link to try out the agent.

Co-authored-by: Kathy Wu <wukathy@google.com>
PiperOrigin-RevId: 899093067
2026-04-13 11:16:15 -07:00
Google Team Member 0acee3175a chore: Update dependencies and release configuration for the Agent Identity feature
PiperOrigin-RevId: 898786239
2026-04-12 22:51:19 -07:00
Google Team Member abcf14c166 feat: Promote BigQuery tools to Stable
In preparation to launching GA of the BigQuery agentic tools in ADK, this change marks BIG_QUERY_TOOLSET and BIG_QUERY_TOOL_CONFIG as stable features. The experimental decorators and warnings associated with these features have been removed.

PiperOrigin-RevId: 897865928
2026-04-10 13:41:19 -07:00
Kathy Wu e7d8160412 fix: Add "gcloud config unset project" command to express mode flow
If the user created an express mode project but has a different gcloud project set, we should help them unset it so that they doesn't run into permissions errors / the express mode one gets used.

Co-authored-by: Kathy Wu <wukathy@google.com>
PiperOrigin-RevId: 897783336
2026-04-10 11:03:44 -07:00
George Weale 9d4ecbe9fd feat: Add support for Gemma 4 models in ADK
This change updates the Gemma LLM integration to support Gemma 4 models by broadening the model regex from `gemma-3.*` to `gemma-.*`

Close #5156

Co-authored-by: George Weale <gweale@google.com>
PiperOrigin-RevId: 897385272
2026-04-09 17:27:06 -07:00
George Weale 9a1930407a fix: preserve interaction ids for interactions SSE tool calls
Close #5169

Co-authored-by: George Weale <gweale@google.com>
PiperOrigin-RevId: 897334695
2026-04-09 15:33:17 -07:00
Wei (Jack) Sun 5fab983c08 chore: merge release v1.29.0 to main
Merge https://github.com/google/adk-python/pull/5232

Syncs version bump and CHANGELOG from release v1.29.0 to main.

COPYBARA_INTEGRATE_REVIEW=https://github.com/google/adk-python/pull/5232 from google:release/v1.29.0 32e319930a46ec2aa8a27d769e027a14779301ff
PiperOrigin-RevId: 897324259
2026-04-09 15:12:16 -07:00
Liang Wu 2626ad7c69 feat(live): expose live_session_resumption_update as Event in BaseLlmFlow
This enables cross-connection session resumption for Gemini Live API sessions, allowing applications to capture the resumption handle and reuse it upon reconnection.
- Add `live_session_resumption_update` to the skip check condition to ensure it's not discarded when content is empty.
- Yield the event after the skip check, similar to transcription events.
- Add unit test in `test_base_llm_flow.py` to verify the behavior.

Closes #4357

Co-authored-by: Liang Wu <wuliang@google.com>
PiperOrigin-RevId: 897318123
2026-04-09 14:59:44 -07:00
Kathy Wu e3567a6519 fix: Fix credential leakage vulnerability in Agent Registry
Passing in ADC auth headers to non-google MCP toolsets is a vulnerability. To fix, only pass in the headers to Google MCP toolsets.

Co-authored-by: Kathy Wu <wukathy@google.com>
PiperOrigin-RevId: 897230159
2026-04-09 11:59:24 -07:00
Wei (Jack) Sun 2cbb523069 feat(samples): add sample for skill activation via environment tools
Merge https://github.com/google/adk-python/pull/5218

### Link to Issue or Description of Change

**1. Link to an existing issue (if applicable):**
(None, this is a new sample)

**2. Or, if no issue exists, describe the change:**

**Problem:**
There was no sample demonstrating how to use `LocalEnvironment` with `EnvironmentToolset` for manual skill activation (discovering and loading skills by reading files) instead of using the pre-configured `SkillToolset`.

**Solution:**
Created a new sample `local_environment_skill` that demonstrates this pattern:
- Agent is instructed to find skills in `skills/` folder using the `find` command.
- Agent loads skills by reading `SKILL.md` using the `ReadFile` tool.
- Added a weather skill sample and reference data to demonstrate usage.

### Testing Plan

**Unit Tests:**
*(This is a sample/demonstration, so no new unit tests were added for the framework itself.)*

**Manual End-to-End (E2E) Tests:**
1. Ran `adk web contributing/samples`.
2. Interacted with the agent in the Web UI.
3. Prompt: "Can you check the weather in Sunnyvale?"
4. Verified that the agent successfully used `find` to locate the skill, read `SKILL.md`, read `weather_info.md`, and answered correctly.

### Checklist

- [x] I have read the [CONTRIBUTING.md](https://github.com/google/adk-python/blob/main/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 manually tested my changes end-to-end.

COPYBARA_INTEGRATE_REVIEW=https://github.com/google/adk-python/pull/5218 from google:samples/local_env_skill 39404309e8b9237a279ecd6ed14bb87eb84098f0
PiperOrigin-RevId: 897229752
2026-04-09 11:58:35 -07:00
Google Team Member cb4dd42eff fix: avoid load all agents in adk web server
PiperOrigin-RevId: 897179529
2026-04-09 10:22:46 -07:00
Google Team Member e63d991be8 feat: allow users to include artifacts from artifact_service in A2A events using provided interceptor
PiperOrigin-RevId: 897143688
2026-04-09 09:05:44 -07:00
Google Team Member dcc485b23e feat: emit a TaskStatusUpdateEvent for ADK events with no output parts but with event.actions
PiperOrigin-RevId: 896929519
2026-04-09 00:31:52 -07:00
Google Team Member b0715d77a2 feat: Add Parameter Manager integration to ADK
Parameter Manager is a feature of Secret Manager that provides centralized storage and management for workload parameters. It supports various formats (plain text, YAML, JSON) and can reference Secret Manager secrets.

The ADK integration will provide a simplified interface for agents to retrieve rendered parameter values, supporting both global and regional endpoints.

PiperOrigin-RevId: 896823376
2026-04-08 19:31:12 -07:00
Kathy Wu 0fedb3b5eb fix: Change express mode user flow so it's more clear that an express mode project is being created
Also adds link to express mode so the user knows that it is

Co-authored-by: Kathy Wu <wukathy@google.com>
PiperOrigin-RevId: 896778982
2026-04-08 17:08:44 -07:00
Kathy Wu d62558cc2d fix: Custom pickling in McpToolset to exclude unpicklable objects like errlog
Co-authored-by: Kathy Wu <wukathy@google.com>
PiperOrigin-RevId: 896761013
2026-04-08 16:25:54 -07:00
Liang Wu 6b1600fbf5 fix(live): Handle live session resumption and GoAway signal
* Skip sending conversation history when a live session is being resumed using a handle.
* Catch ConnectionClosed and APIError exceptions during live sessions and attempt to reconnect if a session resumption handle is available.
* Handle the server's "go_away" signal by proactively closing the connection to trigger a reconnection with the latest session handle.
* Propagate the "go_away" signal from the Gemini connection to the LlmResponse.
* Add unit tests for reconnection on ConnectionClosed, APIError, skipping history on resumption, and handling the go_away signal.

Closes #4996

Co-authored-by: Liang Wu <wuliang@google.com>
PiperOrigin-RevId: 896687925
2026-04-08 14:04:13 -07:00