2385 Commits

Author SHA1 Message Date
Jacksunwei 4e05efb76c chore: update last-release-sha for next release v1.28.0 2026-03-26 22:45:10 +00:00
Wei (Jack) Sun c57d000699 chore(release/candidate): release 1.28.0 (#5014) 2026-03-26 15:44:57 -07:00
George Weale 5020954920 fix: Update list_agents to only list directories, not validate agent definitions
The list_agents method in AgentLoader no longer attempts to determine the agent language for each directory

Co-authored-by: George Weale <gweale@google.com>
PiperOrigin-RevId: 890078066
2026-03-26 15:28:47 -07:00
Sasha Sobran f7359e3fd4 fix: Default to ClusterIP so GKE deployment isn't publicly exposed by default
Co-authored-by: Sasha Sobran <asobran@google.com>
PiperOrigin-RevId: 890025323
2026-03-26 13:43:21 -07:00
Google Team Member ab9ae0fce7 ADK changes
PiperOrigin-RevId: 889992570
2026-03-26 12:42:09 -07:00
Haiyuan Cao 08be44295d feat(bigquery): Migrate 1P BQ Toolset
- Migrate `tools/bigquery` to `integrations/bigquery` to match standard ADK layout.
- Update unit tests to fully assert integration migration.

Co-authored-by: Haiyuan Cao <haiyuan@google.com>
PiperOrigin-RevId: 889963735
2026-03-26 11:48:57 -07:00
Google Team Member 2f90c1ac09 feat: Optional GCP project and credential for GCS access
PiperOrigin-RevId: 889935432
2026-03-26 10:56:53 -07:00
Google Team Member e6a5de50aa ADK changes
PiperOrigin-RevId: 889912199
2026-03-26 10:16:55 -07:00
Sasha Sobran 96e845ef8c fix: enforce allowed file extensions for GET requests in the builder API
Co-authored-by: Sasha Sobran <asobran@google.com>
PiperOrigin-RevId: 889912141
2026-03-26 10:16:11 -07:00
Google Team Member 7aa1f5252c feat(bigquery): Migrate 1P BQ Toolset
- Migrate `tools/bigquery` to `integrations/bigquery` to match standard ADK layout.
- Update unit tests to fully assert integration migration.

PiperOrigin-RevId: 889891348
2026-03-26 09:38:49 -07:00
Sasha Sobran 116f75d2c9 fix: add agent name validation to prevent arbitrary module imports
Co-authored-by: Sasha Sobran <asobran@google.com>
PiperOrigin-RevId: 889890969
2026-03-26 09:37:59 -07:00
Google Team Member d1121317ef feat(bigquery): Migrate 1P BQ Toolset
- Migrate `tools/bigquery` to `integrations/bigquery` to match standard ADK layout.
- Update unit tests to fully assert integration migration.

PiperOrigin-RevId: 889796517
2026-03-26 06:13:34 -07:00
Haiyuan Cao 166ff99b92 feat(bigquery): Migrate 1P BQ Toolset
- Migrate `tools/bigquery` to `integrations/bigquery` to match standard ADK layout.
- Update unit tests to fully assert integration migration.

Co-authored-by: Haiyuan Cao <haiyuan@google.com>
PiperOrigin-RevId: 889634966
2026-03-25 23:13:27 -07:00
Divyansh Shukla 3e00e95551 fix: returns '<No stdout/stderr captured>' instead of empty strings for clearer agent feedback and correct typing
PiperOrigin-RevId: 889521009
2026-03-25 17:40:37 -07:00
Sasha Sobran 27cc98db5f fix: Update eval extras to Vertex SDK package version with constrained LiteLLM upperbound
Co-authored-by: Sasha Sobran <asobran@google.com>
PiperOrigin-RevId: 889449878
2026-03-25 14:55:12 -07:00
George Weale d78422a405 fix: Handle concurrent creation of app/user state rows in DatabaseSessionService
Introduces a new helper function, `_get_or_create_state`, which uses a nested transaction (SAVEPOINT) to safely attempt creating a state row. If a concurrent transaction has already inserted the row, the inner insert will fail with an IntegrityError, which is caught, and the already-existing row is then fetched

Close #4954

Co-authored-by: George Weale <gweale@google.com>
PiperOrigin-RevId: 889441684
2026-03-25 14:36:28 -07:00
Shangjie Chen f434d2519d chore: Change Pydantic model config to ignore extra fields in Event
Update the `model_config` for `Event` to set `extra='ignore'`. This allows the `Event` model to be initialized with fields not explicitly defined in the model, preventing errors when deserializing data that may contain additional, unneeded fields. This allows the session service to accept 2.0 events.

Co-authored-by: Shangjie Chen <deanchen@google.com>
PiperOrigin-RevId: 889327445
2026-03-25 10:49:05 -07:00
Wei (Jack) Sun 2a90fbc1bf chore: merge release v1.27.4 to main
Merge https://github.com/google/adk-python/pull/4990

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

COPYBARA_INTEGRATE_REVIEW=https://github.com/google/adk-python/pull/4990 from google:release/v1.27.4 71982f2476f2a63df419309ac94658d1ff9228e9
PiperOrigin-RevId: 888928449
2026-03-24 17:09:03 -07:00
GAUTAM V DATLA c5d809e10e fix: populate required for Pydantic BaseModel parameters in FunctionTool
Merge https://github.com/google/adk-python/pull/4778

Closes: #4777

Co-authored-by: Xuan Yang <xygoogle@google.com>
COPYBARA_INTEGRATE_REVIEW=https://github.com/google/adk-python/pull/4778 from gautamvarmadatla:fix/pydantic-basemodel-required-fields 45db622e594885d310d5191a733638476d13964e
PiperOrigin-RevId: 888905953
2026-03-24 16:14:30 -07:00
George Weale 3153e6d74f feat: Add index to events table and update dependencies
Introduces a new index `idx_events_app_user_session_ts` on the `events` table in both V0 and V1 database schemas. This index covers `app_name`, `user_id`, `session_id`, and `timestamp` (descending) to improve query performance.

Modifies `DatabaseSessionService` to automatically create any missing indexes defined in the SQLAlchemy metadata when preparing the database tables.

Close #4827

Co-authored-by: George Weale <gweale@google.com>
PiperOrigin-RevId: 888877174
2026-03-24 15:10:58 -07:00
Sasha Sobran 6c24ccc9ec fix: gate builder endpoints behind web flag
Co-authored-by: Sasha Sobran <asobran@google.com>
PiperOrigin-RevId: 888850792
2026-03-24 14:16:34 -07:00
George Weale 77f1c41be6 fix: Exclude compromised LiteLLM versions from dependencies pin to 1.82.6
Versions 1.82.7 and 1.82.8 of LiteLLM were affected by a supply chain attack and are now explicitly excluded from the dependency constraints for both project and dev dependencies.

Co-authored-by: George Weale <gweale@google.com>
PiperOrigin-RevId: 888818704
2026-03-24 13:10:35 -07:00
Gautier Masse 30b904e596 fix(tools): support regional Discovery Engine endpoints
Merge https://github.com/google/adk-python/pull/4720
Close https://github.com/google/adk-python/issues/4697

Co-authored-by: Xuan Yang <xygoogle@google.com>
COPYBARA_INTEGRATE_REVIEW=https://github.com/google/adk-python/pull/4720 from kaligautier:fix/global-and-regional-region ed0b18d1e47010643d9ac5d6bd48ad88c922fda3
PiperOrigin-RevId: 888728543
2026-03-24 10:11:17 -07:00
Divyansh Shukla b3fcd8a21f feat: Add ability to run individual unit tests to unittests.sh
PiperOrigin-RevId: 888314229
2026-03-23 15:38:23 -07:00
George Weale 995cd1cb68 fix: add protection for arbitrary module imports
Close #4947

Co-authored-by: George Weale <gweale@google.com>
PiperOrigin-RevId: 888296476
2026-03-23 14:58:21 -07:00
George Weale 0f351bffa9 chore: Change log message
The log message when instantiating DatabaseSessionService is updated from "Falling back to..." to "Using..." for clarity.

Close #4890

Co-authored-by: George Weale <gweale@google.com>
PiperOrigin-RevId: 888160397
2026-03-23 10:22:25 -07:00
Google Team Member 4cbc3dcb45 test: add integration tests for ADK's A2A client-server interaction
PiperOrigin-RevId: 888114589
2026-03-23 08:43:36 -07:00
George Weale 4b677e73b9 feat: Extract and merge EventActions from A2A metadata
This change enables the conversion of ADK EventActions, serialized within A2A object metadata, back into ADK Event objects. It includes logic to parse JSON-encoded metadata values and to merge EventActions from multiple sources within an A2A Task

Close #3968

Co-authored-by: George Weale <gweale@google.com>
PiperOrigin-RevId: 886927688
2026-03-20 12:41:10 -07:00
Xiang (Sean) Zhou 0f4c8073e5 feat(a2a): add lifespan parameter to to_a2a()
Support Starlette lifespan protocol in to_a2a() so users can run
async startup/shutdown logic (e.g. initializing DB connections,
loading prompt registries) without resorting to module-level globals.

The lifespan parameter accepts a standard Starlette async context
manager. Internally, a composed lifespan runs the A2A route setup
first, then delegates to the user's lifespan if provided. This also
replaces the deprecated add_event_handler("startup", ...) pattern
with the modern Starlette(lifespan=...) constructor.

Closes #4701

Co-authored-by: Xiang (Sean) Zhou <seanzhougoogle@google.com>
PiperOrigin-RevId: 886892363
2026-03-20 11:27:53 -07:00
Google Team Member 1f9f0fe9d3 fix: error when event does not contain long_running_tool_ids
PiperOrigin-RevId: 886852929
2026-03-20 10:11:23 -07:00
Xuan Yang 0e93faf081 chore: fix format
Co-authored-by: Xuan Yang <xygoogle@google.com>
PiperOrigin-RevId: 886446298
2026-03-19 16:53:59 -07:00
Divyansh Shukla 58c453688f fix: Refactor blocking subprocess call to use asyncio in bash_tool
PiperOrigin-RevId: 886400492
2026-03-19 15:19:03 -07:00
Xiang (Sean) Zhou f35c3a66da fix(tools): support structured datastores in DiscoveryEngineSearchTool
DiscoveryEngineSearchTool hardcoded search_result_mode to CHUNKS, which
fails with a 400 error for structured datastores (e.g. Jira Cloud
connectors) that require DOCUMENTS mode. This broke VertexAiSearchTool
with bypass_multi_tools_limit=True for structured data.

Add auto-detection: default mode is now None, which tries CHUNKS first
and automatically falls back to DOCUMENTS when the API returns the
structured-datastore error. Users can also explicitly set the mode via
the new SearchResultMode enum to skip auto-detection.

Fixes #3406

Co-authored-by: Xiang (Sean) Zhou <seanzhougoogle@google.com>
PiperOrigin-RevId: 886354417
2026-03-19 13:46:43 -07:00
Kathy Wu b157276cbb fix: Allow snake case for skill name
Kebab-case is the standard for skill names/directories given by the Skill spec. However, to enable support for importing within skill scripts (python does not allow imports with kebab-case, only snake case), allow snake case for the skill name.

Co-authored-by: Kathy Wu <wukathy@google.com>
PiperOrigin-RevId: 886351132
2026-03-19 13:39:47 -07:00
George Weale 991c4111e3 fix: Prevent compaction of events with pending function calls
Modified compaction logic to exclude events containing function calls for which no corresponding function response has been recorded in the session. Added helper functions to identify pending function call IDs and check if an event contains such IDs. Applied this exclusion to both sliding window and token threshold-based compaction strategies

Close #4740

Co-authored-by: George Weale <gweale@google.com>
PiperOrigin-RevId: 886268526
2026-03-19 11:01:53 -07:00
George Weale f6ea58b593 fix: Add read-only session support in DatabaseSessionService
This change introduces a separate async session factory for Spanner connections configured with `read_only=True`

Close #4771

Co-authored-by: George Weale <gweale@google.com>
PiperOrigin-RevId: 886267104
2026-03-19 10:58:36 -07:00
Tim Niemueller fdc2b4355b feat: enable suppressing A2A experimental warnings
The ADK experimental warnings can already be disabled with an environment
variable, enable the same behavior for A2A to avoid log spam.

Co-authored-by: Tim Niemueller <timdn@google.com>
PiperOrigin-RevId: 886233489
2026-03-19 09:53:50 -07:00
Google Team Member fbe76595b7 ADK changes
PiperOrigin-RevId: 886119834
2026-03-19 05:29:36 -07:00
Google Team Member 78e5a908dc feat(auth): Integrate GCP IAM Connectors (Noop implementation)
- Introduced a new `AuthScheme` named `GcpIamConnectorAuth` in `google.adk.integrations.iam_connector` package.
- The feature is currently disabled through the newly added `GCP_IAM_CONNECTOR_AUTH`experimentation flag.
- The newly added `GcpAuthProvider` class in `adk/integrations/iam_connector/gcp_auth_provider.py` is for internal ADK use and developer should not depend on it.

PiperOrigin-RevId: 886070137
2026-03-19 03:11:22 -07:00
Liang Wu 1ee0623128 fix: Update import and version for k8s-agent-sandbox
Renames the imported module from `agentic_sandbox` to `k8s_agent_sandbox` in `gke_code_executor.py` and updates the required version in `pyproject.toml` to `>=0.1.1.post3`.

Closes #4883

Co-authored-by: Liang Wu <wuliang@google.com>
PiperOrigin-RevId: 885840142
2026-03-18 16:16:49 -07:00
Akash Bangad c26d35916e fix(models): handle arbitrary dict responses in part_to_message_block
Merge https://github.com/google/adk-python/pull/4780

## Bug

`AnthropicLlm.part_to_message_block()` only serializes `FunctionResponse.response` dicts that contain a `"content"` or `"result"` key. When neither key is present the variable `content` stays as `""` and an empty `ToolResultBlockParam` is sent to Claude.

This silently drops the output of several `SkillToolset` tools:

| Tool | Keys returned | Handled before this fix? |
|---|---|---|
| `load_skill` (success) | `skill_name`, `instructions`, `frontmatter` | **No** |
| `run_skill_script` (success) | `skill_name`, `script_path`, `stdout`, `stderr`, `status` | **No** |
| Any skill tool (error) | `error`, `error_code` | **No** |
| `load_skill_resource` (success) | `skill_name`, `path`, `content` | Yes (`"content"` key) |

Because `load_skill` is the entry-point for skill instructions, Claude models using `SkillToolset` **never received skill instructions**, making the feature completely non-functional with Anthropic models.

## Fix

Added an `else` branch in `part_to_message_block()` that JSON-serializes the full response dict when neither `"content"` nor `"result"` is present:

```python
elif response_data:
    # Fallback: serialize the entire response dict as JSON so that tools
    # returning arbitrary key structures (e.g. load_skill returning
    # {"skill_name", "instructions", "frontmatter"}) are not silently
    # dropped.
    content = json.dumps(response_data)
```

This is consistent with how Gemini handles it — the Gemini integration passes `types.Part` objects directly to the Google GenAI SDK which serializes them natively, so there is no key-based filtering at all.

## Testing plan

Added 4 new unit tests to `tests/unittests/models/test_anthropic_llm.py`:

- `test_part_to_message_block_arbitrary_dict_serialized_as_json` — covers the `load_skill` response shape
- `test_part_to_message_block_run_skill_script_response` — covers the `run_skill_script` response shape
- `test_part_to_message_block_error_response_not_dropped` — covers error dict responses
- `test_part_to_message_block_empty_response_stays_empty` — ensures empty dict still produces empty content (no regression)

All 35 tests in `test_anthropic_llm.py` pass:

```
35 passed in 7.32s
```

Run with:
```bash
uv sync --extra test
pytest tests/unittests/models/test_anthropic_llm.py -v
```

Co-authored-by: Kathy Wu <wukathy@google.com>
COPYBARA_INTEGRATE_REVIEW=https://github.com/google/adk-python/pull/4780 from akashbangad:fix/anthropic-llm-skill-toolset-fallback c23ad3755f94eb8c914203a6389bd3fa755c70be
PiperOrigin-RevId: 885831845
2026-03-18 15:59:01 -07:00
Xuan Yang 41f4b44bc1 chore: Fix copyright notices
Co-authored-by: Xuan Yang <xygoogle@google.com>
PiperOrigin-RevId: 885829552
2026-03-18 15:53:33 -07:00
Kathy Wu 6909a167c8 feat: Add slack integration to ADK
Co-authored-by: Kathy Wu <wukathy@google.com>
PiperOrigin-RevId: 885814460
2026-03-18 15:21:01 -07:00
Kathy Wu 031f581ac6 fix: Update Agent Registry to use the full agent card if available
Co-authored-by: Kathy Wu <wukathy@google.com>
PiperOrigin-RevId: 885813216
2026-03-18 15:18:18 -07:00
Kathy Wu dcccfca1d1 fix: Fix imports for environment simulation files
Co-authored-by: Kathy Wu <wukathy@google.com>
PiperOrigin-RevId: 885801247
2026-03-18 14:52:45 -07:00
Xiang (Sean) Zhou 47aaf66efb fix(live): convert response_modalities to Modality enum before assigning to LiveConnectConfig
RunConfig.response_modalities is typed as list[str] for backward
compatibility, but LiveConnectConfig.response_modalities expects
list[Modality] (an enum). Assigning strings directly causes a Pydantic
serialization warning on every live streaming session:

  PydanticSerializationUnexpectedValue(Expected `enum` - serialized
  value may not be as expected [field_name='response_modalities',
  input_value='AUDIO', input_type=str])

Convert each modality value to types.Modality at the assignment point in
basic.py using types.Modality(m), which is a no-op for values that are
already Modality enums and converts plain strings like "AUDIO" to
Modality.AUDIO. The public RunConfig interface remains list[str] so
existing callers are unaffected.

Fixes: #4869

Co-authored-by: Xiang (Sean) Zhou <seanzhougoogle@google.com>
PiperOrigin-RevId: 885781014
2026-03-18 14:12:16 -07:00
Google Team Member 99a31bf77e refactor: rename agent simulator to environment simulation. Also add tracing into environment simulation
PiperOrigin-RevId: 885759367
2026-03-18 13:28:55 -07:00
sasha-gitg b6185f742d chore: move release workflows to main
Merge https://github.com/google/adk-python/pull/4879

COPYBARA_INTEGRATE_REVIEW=https://github.com/google/adk-python/pull/4879 from sasha-gitg:add-v2-release-workflows-to-main f28f3d1ca069b4a1624253fe49c5a0b04f48c5c9
PiperOrigin-RevId: 885627463
2026-03-18 09:07:20 -07:00
George Weale b8e764715c fix: Reject appends to stale sessions in DatabaseSessionService
This change introduces optimistic concurrency control for session updates. Instead of automatically reloading and merging when an append is attempted on a session that has been modified in storage, the service now raises a ValueError.

Close #4751

Co-authored-by: George Weale <gweale@google.com>
PiperOrigin-RevId: 885334444
2026-03-17 19:55:25 -07:00
Xiang (Sean) Zhou 4c9c01fd4b fix(tools): disable default httpx 5s timeout in OpenAPI tool _request
When PR #2872 migrated RestApiTool from requests (sync) to
httpx.AsyncClient (async), the _request function was left without an
explicit timeout parameter. Unlike requests which has no default timeout,
httpx defaults to 5 seconds — causing ReadTimeout errors for any API
call exceeding that limit. This regression blocked users from upgrading
past 1.23.0.

Set timeout=None on httpx.AsyncClient to restore parity with the
previous requests-based behavior (no timeout).

Fixes #4431

Co-authored-by: Xiang (Sean) Zhou <seanzhougoogle@google.com>
PiperOrigin-RevId: 885287948
2026-03-17 17:17:06 -07:00