2897 Commits

Author SHA1 Message Date
Shangjie Chen dce53ecf49 docs: deprecate v2 branch in README (#6213)
Co-authored-by: Copybara Test <copybara@google.com>
2026-06-24 16:58:23 -07:00
Sasha Sobran 02ffd9890a chore: update release manifest to 2.0.0-beta.0 2026-04-21 19:05:13 +00:00
Sasha Sobran f5c41186c3 fix(tests): update model to gemini-3.1-pro-preview and handle empty streaming chunks 2026-04-21 19:05:11 +00:00
Wei (Jack) Sun 84e792fd1e docs(readme): Update documentation to reflect transition to beta
Updated references from 'Alpha' to 'Beta' and updated the installation example version to 2.0.0b1.

Change-Id: I01a28b7ff7be5cc3281e94e86e19bd083e151de8
2026-04-21 18:07:29 +00:00
Jacksunwei 8275f00eb1 chore: update last-release-sha for next v2 release 2026-04-21 17:26:55 +00:00
Wei (Jack) Sun f3c07f658b chore(release/v2-candidate): release 2.0.0-alpha.3 (#5233)
Co-authored-by: Sasha Sobran <asobran@google.com>
2026-04-21 17:26:54 +00:00
Sasha Sobran 1db4a6f951 chore(release): align manifest with released v2.0.0a2 2026-04-21 15:34:49 +00:00
Google Team Member 1e857eee06 fix: Disable bound token for mcp_tool
PiperOrigin-RevId: 901509317
Change-Id: I6e29638b71e3f762d279309c95047a539b0402ab
2026-04-20 19:14:01 -07:00
Sasha Sobran 2b54c4ac37 fix: block RCE vulnerability via nested YAML configurations in ADK
Co-authored-by: Sasha Sobran <asobran@google.com>
PiperOrigin-RevId: 902898232
Change-Id: I98ccedb70a7e3ce1a7f90d1f236acb0fb551e464
2026-04-20 18:50:14 -07:00
Sasha Sobran e1e12cddc6 fix: bump Vertex SDK version
Co-authored-by: Sasha Sobran <asobran@google.com>
PiperOrigin-RevId: 902757902
Change-Id: I93ede8bf16feffb5fe72bea88a79029300975e83
2026-04-20 18:50:10 -07:00
George Weale 09119c41ad fix(deps): Declare packaging dep and align ValidationError import
Two ADK source files import third-party packages that are not declared
in [project] dependencies, leaving bare `pip install google-adk` one
transitive resolver change away from breaking on `from google.adk import
Runner`:

* utils/model_name_utils.py and cli/cli_deploy.py do
  `from packaging.version import …` at module top level. Reachable from
  the canonical import chain (runners.py -> telemetry.tracing ->
  utils.model_name_utils) and from `adk --help`. Reproduced today by
  uninstalling packaging from a fresh venv.
* tools/environment_simulation/environment_simulation_config.py does
  `from pydantic_core import ValidationError`. pydantic-core ships with
  pydantic, so this works at runtime, but the dep is undeclared. pydantic
  re-exports ValidationError, so swap the import.

Adds packaging>=21.0 to main deps and switches the env_simulation import
to pydantic. Includes guard tests in tests/unittests/test_release_
dependencies.py that pin the contract.

Change-Id: Idab2bffe8ae1d66aa049801fbfff9569af7b7687
2026-04-20 18:17:51 -07:00
Bo Yang c560c8474f feat(samples): Add GitHub OAuth sample to demonstrate token requests
Add a new sample 'auth_oauth' demonstrating how to request a GitHub OAuth token in a workflow and use it to list repositories. Also rename the 'auth_config' sample to 'auth_api_key' for consistency.

Change-Id: I014b2f46f74b3017be89efc092380087179cf533
2026-04-20 17:59:17 -07:00
Wei (Jack) Sun 365fdda698 refactor(cli): Convert absolute imports to relative imports
Changed absolute imports from google.adk to relative imports within the cli/ package to comply with the project rule that CLI should use relative imports.

Change-Id: Iaa2ff11ddbf2b387c0be58ed9600458177cc6108
2026-04-20 15:47:42 -07:00
Wei (Jack) Sun ba1ed3af51 refactor(skills): Split adk-style skill for better AI triggering
The adk-style skill was too broad, covering both architecture and style. Splitting it allows AI assistants to consult only the relevant knowledge base, improving efficiency and accuracy. Also flattened references in adk-style.

Change-Id: I4fb76376fc6ebc31cd48b97874585d3608f33e0d
2026-04-20 15:42:44 -07:00
Xuan Yang 2be47e1a04 test(events): Prevent accidental introduction of snake_case keys in Event serialization
Added a new unit test test_event_serialization_always_camel_case in test_workflow_events.py. The test recursively verifies that all keys in a serialized Event model use camelCase, ensuring consistency with frontend expectations and catching accidental additions of snake_case fields.

Change-Id: I12ff59079b59ad5fd421e659c80450cf10c15bbb
2026-04-20 15:32:49 -07:00
Wei (Jack) Sun 520333ddb9 docs: Simplify AGENTS.md by delegating to adk-style skill
The AGENTS.md file was over-bloated and stale. It has been updated to be a short index-like file that points to the adk-style skill for detailed architecture and style knowledge.

Change-Id: If28f175b763d415a87d2f1f4d7d707c7711b667e
2026-04-20 14:36:28 -07:00
Xuan Yang 0b3d7c49e1 fix(events): Support camelCase in RequestInput
Add alias_generator and populate_by_name to RequestInput model_config to match frontend naming conventions and other event models.

Change-Id: I5eb4a55185d0113d86407c119050bb9885a7962b
2026-04-20 14:33:19 -07:00
Wei (Jack) Sun 3ca6071efe chore(version): Update version to 2.0.0b1 for beta release
The version was changed from 2.0.0a3 to 2.0.0b1 to follow Python standards for beta releases, as part of moving the project to the beta phase.

Change-Id: Ie52c5abb7192daefd8e044dcca44f25b8e029969
2026-04-20 10:49:43 -07:00
George Weale 47deb94880 fix: enable Python 3.10 support for workflow engine
Replace asyncio.timeout() (3.11+) with asyncio.wait_for() so node
timeouts work on Python 3.10. Fix typing.Self import in telemetry
tests with a 3.10-compatible fallback. Update pyproject.toml to
declare >=3.10 and add the 3.10 classifier.

Change-Id: Ibe1dcf4a1d44014891aa487aac6e160203c38a58
2026-04-19 18:47:09 -07:00
Yifan Wang a33bb09a53 Fix adk web trace view
Change-Id: I619187656da6c9baa444b5eb5b63f9eef97b5557
2026-04-18 21:53:00 -07:00
Wei (Jack) Sun 72de38b5fe fix(telemetry): fix workflow tracing context propagation and exporter
Change-Id: Iddd7847175d8a520a22e58f142bc39655976fb25
2026-04-18 18:52:58 -07:00
George Weale 3cdb5f1dd9 fix(workflow): enforce output_schema validation in BaseNode.run()
BaseNode.run() wrapped raw yields into Event(output=item) without
calling _validate_output_data(), so output_schema was never enforced
by the runtime for custom nodes. Moved validation into run() so it
applies centrally to all yields — both raw values and Event objects
with output. Updated tests to remove manual _validate_output_data()
calls and added tests proving runtime enforcement.

Change-Id: I4a984e71ae0027daa5cdfb9e3ba7936688743488
2026-04-17 16:37:42 -07:00
Shangjie Chen 61d0ffd00d chore(workflow): Remove stale TODO about cascading cancellation
The cleanup is already handled by _cleanup_all_tasks in the finally block.

Change-Id: Ia195c61909a6b3da27669c6d80da5362ba5b47d3
2026-04-17 16:36:27 -07:00
George Weale b525328344 fix(workflow): replace broad except Exception with specific exception types
Narrows exception handling across the workflow package to catch only
the specific errors that can actually occur, preventing silent
swallowing of unexpected bugs.

- _base_node.py: except Exception → except ValidationError (4 sites)
- _dynamic_node_scheduler.py: except Exception → except ValidationError
- _rehydration_utils.py: except Exception → except ValidationError (3) + ValueError (1)
- _function_node.py: except Exception → except (TypeError, NameError, AttributeError)
  and except (TypeError, PydanticSchemaGenerationError)

The intentional catch-all in _node_runner.py (top-level node error
boundary) is left unchanged as it correctly handles any failure.

Change-Id: I064450f75ea6650def910a3eae5e24d8995e3abe
2026-04-17 16:17:07 -07:00
Swapnil Agarwal 2af93fd461 use @node decorator to cleanup dynamic node tests
Change-Id: I024c95e3c9988eec787baca76a2a23b55d831197
2026-04-17 15:47:48 -07:00
George Weale 71b96c13d3 fix(workflow): resolve mypy type errors across workflow package
Change-Id: I2384164e21808da32671aaab3a0c608dd86660a3
2026-04-17 15:07:47 -07:00
Swapnil Agarwal 809d7e5c3b Add hitl plus multi-trigger scenario
- Will add fix later in rehydration refactor.

Change-Id: Ibd5a18a8f0e8df8486d950506c45535ca9734db9
2026-04-17 14:38:59 -07:00
George Weale 497f3dd100 fix: resolve test failures from main cherry-picks on v2 branch
- Remove stale base_agent.tracer reference in test_node_functional.py
- Fix expected span names in test_functional.py (v2 uses invoke_agent, not invocation)

Change-Id: Ia47e54d0d811adcafda9b19fe14cf0ab16e2c6b0
2026-04-17 14:24:50 -07:00
Xuan Yang ea0bf27435 refactor(tests): Refactor tests to explicitly handle JSON_SCHEMA_FOR_FUNC_DECL feature flag
Co-authored-by: Xuan Yang <xygoogle@google.com>
PiperOrigin-RevId: 901366486
Change-Id: I2e43d0341acb5846c032c9c4d31b846f2a3bb4f2
2026-04-17 14:24:32 -07:00
Liang Wu 15c4ab7e14 feat(live): Add save_live_blob query parameter to /run_live endpoint
This change introduces a new query parameter `save_live_blob` to the `/run_live` WebSocket endpoint in the ADK web server. When set to true, this parameter enables saving of live blobs during the session. The default value is false. Unit tests are updated to cover this new parameter.

Closes issue #4707

Co-authored-by: Liang Wu <wuliang@google.com>
PiperOrigin-RevId: 901280577
Change-Id: I1359cb831c5bb7ddfa11e5d1d4ebed18080d00f2
2026-04-17 14:24:18 -07:00
Google Team Member db51038631 chore: Add readable message on import errors
PiperOrigin-RevId: 901187928
Change-Id: Ia499a16e1ef033a907cacc8489ece832e473528f
2026-04-17 14:24:06 -07:00
Kacper Jawoszek fe1055f472 chore: Update telemetry owner
Co-authored-by: Kacper Jawoszek <jawoszek@google.com>
PiperOrigin-RevId: 901179890
Change-Id: I45845cf452112b61a97a1ffac0cbddd0cb93c9ae
2026-04-17 14:23:49 -07:00
Google Team Member 529af898e8 feat: add native OpenTelemetry agentic metrics
New metrics added:
- gen_ai.agent.invocation.duration
- gen_ai.tool.execution.duration
- gen_ai.agent.request.size
- gen_ai.agent.response.size
- gen_ai.agent.workflow.steps

New metrics and attributes are in line with OTel semantic conventions where possible, and will be formally to the semconv later.

PiperOrigin-RevId: 901156576
Change-Id: I0d6afc50287e643245d6fc7690d9841d9f22eaab
2026-04-17 14:23:34 -07:00
Mimi Sun 8ad2d8ead0 feat: Add an option to prevent the SaveFilesAsArtifactsPlugin from attaching reference file parts to the message
Default is True to match existing behavior. Setting it to False prevents the model from loading artifact directly from a provided canonical URI, and makes the behavior consistent between InMemoryArtifactService and other services with canonical URIs.

PiperOrigin-RevId: 901061080
Change-Id: I3079a3cd57e4517c38b62c8e8a7bc1278ae1936e
2026-04-17 14:23:21 -07:00
BowedMars2 1b89fc0538 test: adds missing unit tests for example_util (Issue #4623)
Merge https://github.com/google/adk-python/pull/4802

**Please ensure you have read the [contribution guide](https://github.com/google/adk-python/blob/main/CONTRIBUTING.md) before creating a pull request.**

### Link to Issue or Description of Change

- Closes: #4623

**Problem:**
example_util.py was completely missing unit tests.

**Solution:**
I added unit tests for a variety of situations:

- Converting a text-only example to a string
- Converting a text-only example _with multiple Parts_ to a string
- Converting a text-only example to a string when the output contains a conversation between the user and model
- Converting another text-only example with a conversational output, but with clumped messages from each
- Converting an empty list to a string
- Converting an example including a function call to a string
- Converting an example including a function _response_ to a string
- Converting an example including both a function call _and_ a function response to a string
- Converting an example with text, a function call, and a function response to a string
- Building System Information from a list of examples
- Building System Information from an example provider

### Testing Plan

I ran the tests personally, and they successfully passed.

**Unit Tests:**

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

33 passed in 2.55s

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

To test my change, simply run the unit tests and they should pass. If you want to verify the effectiveness of my tests, try modifying the input given to my unit tests and see if they fail.

### Checklist

- [✓] I have read the [CONTRIBUTING.md](https://github.com/google/adk-python/blob/main/CONTRIBUTING.md) document.
- [✓] I have performed a self-review of my own code.
- [✓] I have commented my code, particularly in hard-to-understand areas.
- [✓] I have added tests that prove my fix is effective or that my feature works.
- [✓] New and existing unit tests pass locally with my changes.
- [✓] I have manually tested my changes end-to-end.
- [✓] Any dependent changes have been merged and published in downstream modules.

### Additional context

- I noticed build_example_si takes an argument for query even though it's not used if you pass in a list rather than a BaseExampleProvider. Is this expected behavior that is there for a reason, or should I open an issue for this?
- I also noticed that when model is None, it defaults to Gemini 2. This seems like it could cause issues on the user end. Is there a reason for this functionality?

COPYBARA_INTEGRATE_REVIEW=https://github.com/google/adk-python/pull/4802 from BowedMars374878:Issue-#4623 efa090e264b4cc155d4937ea2f2d8d90d7753ae6
PiperOrigin-RevId: 901025765

Change-Id: Ief9c2163e8d975f231a67a311967753a46c71d29
2026-04-17 14:23:07 -07:00
Wei (Jack) Sun af2c30f3bd chore: merge release v1.31.0 to main
Merge https://github.com/google/adk-python/pull/5362

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

COPYBARA_INTEGRATE_REVIEW=https://github.com/google/adk-python/pull/5362 from google:release/v1.31.0 f0204a7fcba013d3e59af5c745d507e234de764f
PiperOrigin-RevId: 901020139

Change-Id: I2e1d35cfa77b0aa87ff41074b74ac03a5bd44d72
2026-04-17 14:22:52 -07:00
Liang Wu c0d6dbd3a0 fix(live): mark all agents' Event as from other agents
This will allow agent transfer to work smoothly in live workflow. See the comment added for details.

Closes issue #5238

Co-authored-by: Liang Wu <wuliang@google.com>
PiperOrigin-RevId: 900993889
Change-Id: I34c5f768482bc71351278dc0a2466885799dad1a
2026-04-17 14:22:40 -07:00
Liang Wu 59c92cbf88 fix(live): treat input transcription as user message
During agent transfer, the input transcription is represented as user input. Also, the previous implementation is incorrect in that the LlmResponse could never have content.role == 'user'. Modified the docstring to match the behavior.

Co-authored-by: Liang Wu <wuliang@google.com>
PiperOrigin-RevId: 900980704
Change-Id: Ia48057c7f02b10be63f6d0e255c07fab177e759d
2026-04-17 14:22:29 -07:00
Morgan Roux 17f3a8a929 chore: Replace old model gemini-2.0 references by 2.5
Merge https://github.com/google/adk-python/pull/4705

### Link to Issue or Description of Change

- Closes: #4666

**Problem:**
Gemini-2.0-flash model is still used in integration tests, but disabled for new users

**Solution:**
Replace all occurrences of Gemini-2.0-flash by Gemini-2.5-flash, in integration tests and docstrings.
Because gemini-2.0 is still enabled for some users, this PR doesn't clean the model from unit tests.

### Testing Plan
Run already existing unittests and integration tests

### 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/4705 from morganroux:fix/issues/4666 3c390a2ed3abb7b2fc7bd99cfb801e8a2b1f5343
PiperOrigin-RevId: 900973552

Change-Id: I1d2dd4c749522b529537d5863e4a56865927da95
2026-04-17 14:22:21 -07:00
Enjoy Kumawat 9a962c90c6 fix: handle None state values in skill_toolset after session rewind
Merge https://github.com/google/adk-python/pull/5204

Co-authored-by: Xuan Yang <xygoogle@google.com>
COPYBARA_INTEGRATE_REVIEW=https://github.com/google/adk-python/pull/5204 from enjoykumawat:fix/load-skill-tool-none-guard ad027fc1d282be4ae28f7154ea7fcd3610a62e8c
PiperOrigin-RevId: 900930037

Change-Id: I9d7b06d87ffd95fd8926c497b226e2694ac1e578
2026-04-17 14:21:55 -07:00
George Weale 1237e01c8b 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
Change-Id: Id1ae9f5050d38753c5d4791acc6f5ab3332a2f9f
2026-04-17 14:21:41 -07:00
Liang Wu 68620abc2b 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
Change-Id: Iadaaf9b03499d969f18e03eafb9fc21d79d94d87
2026-04-17 14:21:29 -07:00
Kathy Wu d3d0bdaf72 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
Change-Id: Idf2ec208616528612a428a5260ea0455dd986174
2026-04-17 14:21:13 -07:00
Shangjie Chen e5197ac584 refactor(workflow): Downgrade lifecycle logs to DEBUG to reduce noise
Change-Id: I78abb19268f85ce2057bd7b2d8b2bbdcd79f860e
2026-04-17 13:14:53 -07:00
Shangjie Chen 87d3bf5355 test(workflow): Add test for nested workflow timeout
Verify that a nested workflow timeout raises NodeTimeoutError.

Change-Id: Ice80d167bd2edc81ea82ffb5d30a479df283c6df
2026-04-17 12:59:05 -07:00
Yifan Wang 9f84d3d093 update adk web to latest
Change-Id: I728527d0d35c2cdeb103c25ead67adaabb01f7c3
2026-04-17 11:22:31 -07:00
Yifan Wang 421f99e003 add v2 flag for installing v2 dependecy when dpeloy to AE
Change-Id: Ic53d4121a1ef9ddc74809d897f5081a083826668
2026-04-17 11:21:54 -07:00
Shangjie Chen b03073988c refactor(workflow): Decouple Context from scheduler to avoid circular imports
Use ScheduleDynamicNode protocol for type hints in context.py to avoid importing the concrete DynamicNodeScheduler at the module level. This helps prevent circular dependencies.
DynamicNodeScheduler now explicitly implements the protocol.

Change-Id: Ic5f58443d84b68bbcfd5e7b3aeea28f06e48c5e1
2026-04-17 11:08:28 -07:00
Shangjie Chen 556eedc958 fix(samples): update burgers test case in task sub agent
Change-Id: I91fa7b7199484eb75464158b4db502b322bcab50
2026-04-17 10:54:53 -07:00
Xuan Yang 6331076b89 feat(agents): Deprecate legacy orchestration agents to guide migration to Workflows
Change-Id: Iaf3e6dce009e4c78c70d0e7ea34d4735d3d59859
2026-04-17 09:56:32 -07:00