2708 Commits

Author SHA1 Message Date
Jacksunwei 6d15e19f05 chore: update last-release-sha for next release v2.1.0 2026-05-23 00:11:52 +00:00
Wei (Jack) Sun 3a143eb716 chore(release/candidate): release 2.1.0 (#5816)
Co-authored-by: asobran <asobran@google.com>
2026-05-22 20:11:38 -04:00
asobran 7ad7994744 chore: Set python unit test timeout to 10 minutes
Change-Id: Ic0f6706714c31984783b0877446a5cf2f1a6af23
2026-05-22 17:00:10 -07:00
Google Team Member eaff9c021e feat: Update check-file-contents.yml to check for non-mTLS hardcoded endpoints
Merge 29fcd80cd084e24611cae24a6fa773577a76581e into 104edc8317

ORIGINAL_AUTHOR=agrawalradhika-cell <agrawalradhika@google.com>
GitOrigin-RevId: 46a8802b04e4d4344763ae415ff5424b2bfde4bc
Change-Id: I3c6c4e92c92c99567be2bb938e95ae950bbbc634
2026-05-22 16:43:18 -07:00
George Weale 104edc8317 fix: convert Union[Pydantic, Pydantic] tool args at runtime
FunctionTool._preprocess_args only converted dict args to a Pydantic
model for single-model and Optional[Model] annotations. A
Union[ModelA, ModelB] parameter was left as a raw dict, so
isinstance checks inside the tool failed with "Unexpected entity
type: <class 'dict'>"

Use pydantic.TypeAdapter to validate against the full Union so
pydantic picks the matching member. None and instances of any
declared union member pass through unchanged; instances of
unrelated BaseModels fall back to the existing graceful-failure
warning path.

Close #5799

Change-Id: Ie69f8efc8395162eac375a0eaad0c77ed2097cec
2026-05-22 16:21:58 -07:00
Wenhua Zhang b3d0759e42 feat: Preserve transcription event order in conversation trajectory
Refactor live inference to emit synthetic text events for output
transcriptions as they arrive (streaming), rather than accumulating all
transcriptions and appending a single synthetic event after the turn
completes. This preserves event ordering and enables downstream
consumers to process transcriptions incrementally.

Co-authored-by: Wenhua Zhang <wenhzhang@google.com>
Change-Id: Idca79968729f2145ebf1f1c993d79ab7f6a3bd78
2026-05-22 15:47:43 -07:00
Emily Feng cbd14ebf99 feat: Add support for creating sandboxes from templates and snapshots
This change allows AgentEngineSandboxComputer to create new sandboxes
using either a specified sandbox template or a sandbox snapshot. The
environment variables VMAAS_SANDBOX_TEMPLATE_NAME and
VMAAS_SANDBOX_SNAPSHOT_NAME are introduced to configure this behavior.

Co-authored-by: Emily Feng <emilyfeng@google.com>
Change-Id: Iebdd980a16966ba765cacbce6d63d0d5b691650a
2026-05-22 15:47:41 -07:00
Han Cao db064160bf feat: Add chart generation and artifact loading to data agent
Introduces a generate_chart tool to the Data Agent sample, leveraging
Altair and vl-convert to render Vega-Lite specifications into charts.

Co-authored-by: Han Cao <huanc@google.com>
Change-Id: I5765487406d511e650091f5dc884102c43568fd4
2026-05-22 15:38:02 -07:00
Xuan Yang ecb759cc16 ci: Support bot-authored commits in PR handler
Ensure both types of Copybara PR commits are correctly identified and parsed by checking author email, headers, and updated merge regex.

Change-Id: Ic0cc19f67a3db4637fa597702393a11802b3f9aa
2026-05-22 13:21:52 -07:00
Google Team Member e56c021ef7 feat: Fix error message telemetry for tool calls
Merge: https://github.com/google/adk-python/pull/5797

ORIGINAL_AUTHOR=Achuth Narayan Rajagopal <achuth.narayan@gmail.com>
GitOrigin-RevId: 5c41f0352b2a2852eda1b1a80b746477ba4f61de
Change-Id: I07edf4c4fff92e37228f876f16cf53310146a257
2026-05-22 11:49:09 -07:00
George Weale 68785f53cf chore: edit docs
Change-Id: I47379cb495725595571ae5274ad34d8201ba1ca3
2026-05-22 11:41:51 -07:00
Google Team Member eb379bea5b feat: Add user.id to gen_ai.user.message log records for telemetry
Merge: https://github.com/google/adk-python/pull/5796

ORIGINAL_AUTHOR=Achuth Narayan Rajagopal <achuth.narayan@gmail.com>
GitOrigin-RevId: ec8265ecab7ae4342f8a6b5605f112e3a3673775
Change-Id: Ib77c4e2ad3df29a7ca734f142b9dc42d0890f429
2026-05-22 11:36:14 -07:00
George Weale a4f394e139 chore: edit files
Change-Id: I4e3e3e9f1846520f3fda86cc83453b30bdd336ef
2026-05-22 10:47:37 -07:00
Kathy Wu 92cf19255e fix: Resolve circular import in base_tool
Importing `ToolContext` at the top level in `base_tool.py` created a circular import cycle when `google.adk.tools.function_tool` was imported.
The cycle was: `base_tool` -> `tool_context` -> `CallbackContext` -> `agents` -> `BaseAgent` -> `Event` -> `LlmResponse` -> `LlmRequest` -> `BaseTool`.

Moving `ToolContext` to `TYPE_CHECKING` breaks this runtime cycle, using `from __future__ import annotations` to preserve type hints.

Change-Id: I34731f46cf5aa4665ad3c6604495ad5fd84f8aa5
2026-05-22 09:56:00 -07:00
Copybara 9fd0e07ff8 chore: Support test runs on v1 pull requests
Change-Id: Ifcfa08f31513e6b25023dbe81d3de70645912303
2026-05-22 09:50:23 -07:00
Sasha Sobran 5f91a9db03 fix: lazy-import GCS evaluation managers in evals utility
Fixes https://github.com/google/adk-python/issues/5787

Change-Id: I0aadfb11fedc49c1d45d4fcd9f89087c27a0e6ea
2026-05-22 09:50:10 -07:00
asobran 416775dcce fix: Make google-cloud-storage import lazy in skill utils
Change-Id: Id86475d867e31e3f8d3ee1429f2b8a7b8c53da34
2026-05-22 08:44:54 -07:00
George Weale 7e38fc811e fix: resolve circular import caused by llm_request
Change-Id: Icfa51c1323a751921bb35000cd6aababe9033c09
2026-05-21 17:35:46 -07:00
Yifan Wang 1f245535ff fix: update EditFileTool to handle cross-platform line breaks and escape regex characters
Change-Id: Id155218fa6feb7e004684d8f96cd0598fa4d2766
2026-05-21 16:15:26 -07:00
Yifan Wang 1b86d8eafe chore: Add single folder support in adk web
Change-Id: If593c0118bb44ec4a4dd836d8c5d5c4025591af2
2026-05-21 16:15:15 -07:00
Shangjie Chen 99087ba8bb chore: Add and update copyright headers for integrations and BQ tools
Prepend missing license and copyright headers to CrewAI, LangChain, ADK Labs, and BigQuery redirect tools. Correct the copyright year to 2026 in the environment simulation plugin.

Change-Id: Id68109102972e02bcf39a3f44bd3a4c51a18146a
2026-05-21 13:22:18 -07:00
Kathy Wu b9751eb9df fix: Fix bug where grounding metadata in Gemini 3.1 live was being silently discarded
In Gemini 3.1 live, LlmResponse packets sometimes contain only grounding metadata - don't skip these responses

Change-Id: I9e2c1080395588d61aefffd1b6570102930e1fe0
2026-05-21 11:06:44 -07:00
Kathy Wu d17a2a3221 fix: fix input and output transcription finished events for Gemini v3.1
Change-Id: I3c33e84569d5f63f46c99154afa9e9d68a2fdf3c
2026-05-21 10:41:12 -07:00
Xuan Yang 85223e629e fix(ci): Use absolute path for PYTHONPATH in upload docs workflow
The upload-adk-docs-to-vertex-ai-search workflow failed with ModuleNotFoundError: No module named 'adk_answering_agent' because the relative PYTHONPATH path did not resolve correctly under some CI environment execution states. Resolved by using the absolute ${{ github.workspace }} path.

Change-Id: I18c72b671f33c134bd08601b4a97671a1b1b0fa9
2026-05-21 10:24:16 -07:00
Sasha Sobran 5b79666db7 chore: Delete automated main -> v2 sync workflow
Change-Id: I21678f6cb23d757f4195fdba064ef6fae7e853ea
2026-05-21 10:01:40 -07:00
Sasha Sobran 340b816531 BEGIN_PUBLIC
ci: Repoint v2 release workflows and manifests to v1 branch
END_PUBLIC

This change repurposes all secondary v2 release workflows (cherry-pick, cut, finalize, please, publish) and Release Please manifest configs to manage legacy patch releases on the v1 branch, as v2 GA releases are now serviced directly from main.

BUG=None
TAG=agy
CONV=8876d6f0-694d-4980-9005-979adc5a2ef4

Change-Id: I9c682f5ec2c21fde95e0f00930e2442e254b33b3
2026-05-21 09:46:08 -07:00
Yifan Wang 1307f8eeba Fix --reload_agents for web
Change-Id: If31a5e5a30ab8c3ee5480494e6d42e7c21240429
2026-05-21 09:26:42 -07:00
Shangjie Chen 1ba586383f style(cli): Format code and assets to comply with pyink and linter guidelines
Reformat tests/unittests/cli/utils/test_gcp_utils.py using pyink, and restore the trailing newline in runtime-config.json to align with pre-commit style rules.

Change-Id: Id2593bf761845d15c45cbde18f6d3a8f0e5dd639
2026-05-21 09:10:27 -07:00
Sasha Sobran 933653c61c fix(tools): Prevent session drop on MCP tool error
Enable MCP graceful error handling by default and retrieve background session context task exceptions. This prevents unhandled AnyIO TaskGroup transport failures from bubbling through the event loop and abruptly terminating live streaming sessions with 1006 abnormal closure.

Change-Id: Ib4669fb57cddfc6ce61f9a3991b80db3f2b3e9ab
2026-05-21 08:32:33 -07:00
Xuan Yang 84fa984ae0 fix(ci): Add python-dateutil dependency to stale-bot workflow
The stale-bot workflow failed with ModuleNotFoundError because adk_stale_agent imports python-dateutil but the runner environment did not have it installed. Added python-dateutil to the pip install step.

Change-Id: I1002c8eb7bb8fe2f9e106e85c3b5a7f990fe1c62
2026-05-20 14:54:22 -07:00
Xuan Yang 55cbc8c9e8 fix(ci): Prevent workflow failures in relocated adk_team samples
Workflows failed because the gemini-2.5-pro model is not available for our projects and the CONTRIBUTING.md relative path resolved incorrectly after relocation. Updated the model to gemini-3.5-flash and adjusted the path resolver depth.

Change-Id: Iffc8a2b0044f3d73b0cb0b364db220d2bd055683
2026-05-20 14:37:22 -07:00
Xuan Yang 363a68600e ci: Fix workflow failures by updating paths for relocated adk_team samples
The samples in `contributing/samples/adk_documentation` and other `adk_..._agent` directories were moved to `contributing/samples/adk_team/`. This caused workflows to fail with `ModuleNotFoundError` because `PYTHONPATH` was pointing to the old location.
Updated `PYTHONPATH` and module names in 7 workflow files to resolve correctly.

Change-Id: I5495a086b2ddc8f7bbd8c70b529271e06baced91
2026-05-20 11:26:37 -07:00
Sasha Sobran 57d677c5cd fix(cli): Inform user to install optional dependency on missing google.cloud
Importing `gcp_utils` during `adk create` caused a ModuleNotFoundError because `resourcemanager_v3` was imported at module level. Moved the import into `list_gcp_projects` function scope where ImportError is caught specifically to raise an informative RuntimeError indicating they need to install the 'gcp' optional dependency. Also added google-cloud-resource-manager to optional dependencies.

Fixes https://github.com/google/adk-python/issues/5766

Change-Id: I9469e03c72342730cd0a1418551305a5e8058f60
2026-05-20 16:04:21 +00:00
Shangjie Chen 3329ced0b9 fix(tests): Append trailing newline to JSON test outputs
JSON test files generated by the agent test runner were missing trailing newlines, causing the pre-commit end-of-file-fixer hook to fail. Added an explicit newline write on serialization.

Change-Id: Idaffc4f2c23fa213f595ddef2188b0050aeb431d
2026-05-19 16:27:47 -07:00
Shangjie Chen 6d7bab6897 test(workflow): Move agent transfer integration tests to workflow folder
Migrated the multi-agent dynamic transfer integration tests from `flows/llm_flows/test_agent_transfer.py` to the consolidated `workflow/` directory to align with ADK 2.0 patterns.

During this migration and alignment:
1. Fixed a critical runner bug in `NodeRunner._track_event_in_context` where structured parent nodes (like SequentialAgent or LoopAgent) executing legacy recursive sub-agents internally would mistakenly intercept and bubble up the sub-agent's internal routing actions, causing crashing `unrelated transfer` errors in the parent scheduler. Fixed by restricting route/transfer tracking to native node events (`not event.author` or `event.author == self._node.name`).
2. Restored five previously deleted legacy structured transfer tests (`test_auto_to_single`, `test_auto_to_auto_to_single`, `test_auto_to_sequential`, `test_auto_to_sequential_to_auto`, and `test_auto_to_loop`) to maintain regression protection.
3. Hardened the suite with dedicated new tests for sibling peer transfers, child-to-parent climbing transfers, grandchild nested transfers, self-transfer blocking, and unrelated sandbox crossing defenses.

Change-Id: I2f087c211a5a78508689f4dfeea2c533219df208
2026-05-19 16:00:24 -07:00
Wei (Jack) Sun 6e0c1e5918 chore: merge release v2.0.0 to main (#5755)
Co-authored-by: Sasha Sobran <asobran@google.com>
Co-authored-by: Jacksunwei <1281348+Jacksunwei@users.noreply.github.com>
2026-05-19 13:06:46 -04:00
Sasha Sobran e6537decc9 chore(release): configure release-please for v2.0.0 GA
Change-Id: If39d565130df657d08e4367394c33771e68ad364
2026-05-19 13:36:37 +00:00
Xuan Yang 7fc5b0efc4 test(samples): Verify behavior of parallel functions and Pydantic arguments with new tests
Generated test JSON files for parallel_functions and pydantic_argument samples to verify their behavior.

Also fixed a test replay issue by ignoring timestamps in state (in agent_test_runner.py) to prevent false failures due to dynamic data.

Note: Some sample agents could not have tests generated successfully due to:
1. agent_tool_with_grounding_metadata: Fails on replay because AgentTool hides sub-agent events, causing mock LLM to get out of sync.
2. hello_world_stream_fc_args: Fails on rebuild because streaming function calls are not supported in the Unary API used by the test recorder.
3. output_schema_with_tools: Has external dependencies (Wikipedia/Google Search), making it unsuitable for automated regression tests without proper mocking.

Change-Id: I69df7daf49d175905dcbd85cf70914e460717915
2026-05-19 13:36:37 +00:00
Sasha Sobran 162279358c chore: switch main to v2.0.0 GA (transition to v2)
Co-authored-by: Bo Yang <ybo@google.com>
Co-authored-by: Wei Sun (Jack) <weisun@google.com>
Co-authored-by: George Weale <gweale@google.com>
Co-authored-by: Swapnil Agarwal <swapnilag@google.com>
Co-authored-by: Xuan Yang <xygoogle@google.com>
Co-authored-by: Shangjie Chen <deanchen@google.com>
Co-authored-by: Yifan Wang <wanyif@google.com>
Co-authored-by: Kathy Wu <wukathy@google.com>
2026-05-19 02:01:33 +00:00
Wei (Jack) Sun e13ada758a chore: merge release v1.34.0 to main
Merge https://github.com/google/adk-python/pull/5747

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

COPYBARA_INTEGRATE_REVIEW=https://github.com/google/adk-python/pull/5747 from google:release/v1.34.0 160b1b45e4
PiperOrigin-RevId: 917514751
2026-05-18 17:40:10 -07:00
Xuan Yang 07a9a01b3c fix: Preserve live_session_id in function call handling
Fixes https://github.com/google/adk-python/issues/5702

Co-authored-by: Xuan Yang <xygoogle@google.com>
PiperOrigin-RevId: 917452441
2026-05-18 15:17:43 -07:00
Google Team Member 03b915b1bd fix(anthropic): map negative thinking_budget to adaptive thinking
- Claude Opus 4.7 rejects `thinking.type: "enabled"` with a 400 error
  and requires `thinking.type: "adaptive"`; adaptive is also the
  recommended mode for Opus 4.6 / Sonnet 4.6 where `"enabled"` is
  deprecated.
- The genai `ThinkingConfig.thinking_budget = -1` (AUTOMATIC) sentinel
  is the natural mapping for adaptive: the model picks the depth
  itself. Callers opt in with `-1`; positive values keep the existing
  `"enabled"` path so older models are unchanged.
- Bump `anthropic>=0.78` in `pyproject.toml`; 0.78 introduced
  `ThinkingConfigAdaptiveParam`. The previous floor (`>=0.43`) let
  Kokoro install `anthropic==0.75.0`, which crashes the new tests
  with `AttributeError: module 'anthropic.types' has no attribute
  'ThinkingConfigAdaptiveParam'`.

PiperOrigin-RevId: 917449729
2026-05-18 15:12:26 -07:00
George Weale 57d8fc7d81 perf(models): guard debug log evaluation with isEnabledFor
Co-authored-by: George Weale <gweale@google.com>
PiperOrigin-RevId: 917411239
2026-05-18 13:57:16 -07:00
Arpit Jain e7ca943b6b ci: declare contents: read on seven workflows missing a permissions block
Merge https://github.com/google/adk-python/pull/5687

Co-authored-by: Xuan Yang <xygoogle@google.com>
COPYBARA_INTEGRATE_REVIEW=https://github.com/google/adk-python/pull/5687 from arpitjain099:ci/add-permissions c145c102024d761ee90d0643a8d26f399578a0f4
PiperOrigin-RevId: 917369094
2026-05-18 12:28:52 -07:00
Google Team Member baf7efbaa9 feat: Added config option to include tool calls/responses in conversation history passed to user simulator
PiperOrigin-RevId: 917340645
2026-05-18 11:31:14 -07:00
Google Team Member 48f1b30251 feat: Simplify data retrieved handling of ask_data_agent tool and ask_data_insights tool
PiperOrigin-RevId: 917326615
2026-05-18 11:04:04 -07:00
Google Team Member 59f7347a63 fix(small): Convert events to the A2A format while respecting user vs agent role
PiperOrigin-RevId: 917275872
2026-05-18 09:28:29 -07:00
Jorge Israel Frómeta Moya 3d07960a70 fix: use tool_responses role for gemma4 models in LiteLLM integration
Merge https://github.com/google/adk-python/pull/5655
Closes: #5650

Co-authored-by: Xuan Yang <xygoogle@google.com>
COPYBARA_INTEGRATE_REVIEW=https://github.com/google/adk-python/pull/5655 from jfrometa88:main d74b5216b0937ff371b25cc8f272ee8ab33c8dc9
PiperOrigin-RevId: 917231422
2026-05-18 07:54:00 -07:00
Google Team Member 12844939f1 fix: only serialize llm_response to json if it will be included in the trace
PiperOrigin-RevId: 917108173
2026-05-18 02:36:34 -07:00
Google Team Member bd062ec9eb perf: lazy-load service registries and split apps.app to cut cold start ~8%
PiperOrigin-RevId: 916278514
2026-05-15 18:35:23 -07:00