Skip to content

chore: sync main -> v2#5762

Closed
Jacksunwei wants to merge 380 commits into
v2from
main
Closed

chore: sync main -> v2#5762
Jacksunwei wants to merge 380 commits into
v2from
main

Conversation

@Jacksunwei
Copy link
Copy Markdown
Collaborator

Automated sync of v1 changes from main into v2. The oncall is responsible for reviewing and merging this PR. Resolve conflicts in favor of the v2 implementation.

wukath and others added 30 commits April 3, 2026 15:04
Co-authored-by: Kathy Wu <wukathy@google.com>
PiperOrigin-RevId: 894266946
Adds a **Description** column to the function routing table in `SKILL.md` so the LLM can select the correct reference file without extra `load_skill_resource` calls
- Replaces internal "1P" terminology with "BigQuery tools" for clarity

Co-authored-by: Haiyuan Cao <haiyuan@google.com>
PiperOrigin-RevId: 894329869
Adds a configurable `view_prefix` field to `BigQueryLoggerConfig` (default `"v"`) so that multiple plugin instances sharing a dataset can use distinct prefixes to avoid overwriting each other's auto-created analytics views
- Validates that `view_prefix` is non-empty at init time
- Wires `view_prefix` into `_create_analytics_views` in place of the hardcoded `"v_"` prefix

Co-authored-by: Haiyuan Cao <haiyuan@google.com>
PiperOrigin-RevId: 894331973
The `SecretManagerClient` now accepts a `location` parameter to connect to a regional Secret Manager endpoint.

PiperOrigin-RevId: 894356924
remote_a2a_agent is only including A2ATransport.jsonrpc on the default supported list, but it should also include http_json since it is a common transport (default used by agent engine)

Co-authored-by: Kathy Wu <wukathy@google.com>
PiperOrigin-RevId: 895444831
This endpoint provides detailed **static** information about an application's agents, including their description, instructions, tools, and sub-agents, specifically for LlmAgent instances.

Co-authored-by: Liang Wu <wuliang@google.com>
PiperOrigin-RevId: 895470828
… ToS

Co-authored-by: Kathy Wu <wukathy@google.com>
PiperOrigin-RevId: 895514895
Co-authored-by: Liang Wu <wuliang@google.com>
PiperOrigin-RevId: 895518689
…tTool

  - Updates `parameters_json_schema` to accept `short_options` (object) and `positional_args` (array).
  - Updates `_SkillScriptCodeExecutor._build_wrapper_code` to materialize these options for both Python and Shell scripts.
  - Appends `--` before positional arguments to remove ambiguity in CLI parsing.
  - Adds comprehensive unit tests.

PiperOrigin-RevId: 895536577
Merge #5128

### Link to Issue or Description of Change

**1. Link to an existing issue (if applicable):**

- Closes: #5127

**Problem:**
When `--agent_engine_config_file` is set to a path that does not exist, `to_agent_engine` previously behaved like no config file was provided.

**Solution:**
This change raises `click.ClickException` with a message that includes the resolved path.

### Testing plan

- [x] `uv run python -m pytest tests/unittests/cli/utils/test_cli_deploy.py -v`
- [x] Manual test `adk deploy agent_engine ... --agent_engine_config_file /nonexistent.json` and confirm a clear error before remote deploy. The same command with correct filename relative to parent directory of the agent does not fail.

**Unit Tests:**

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

```
uv run python -m pytest tests/unittests/cli/utils/test_cli_deploy.py -v
=========================================================================================================================== test session starts ===========================================================================================================================
platform darwin -- Python 3.11.13, pytest-9.0.2, pluggy-1.6.0 -- /Users/rei/Repos/adk-python/.venv/bin/python3
cachedir: .pytest_cache
rootdir: /Users/rei/Repos/adk-python
configfile: pyproject.toml
plugins: mock-3.15.1, xdist-3.8.0, asyncio-1.3.0, langsmith-0.7.25, anyio-4.13.0
asyncio: mode=Mode.AUTO, debug=False, asyncio_default_fixture_loop_scope=function, asyncio_default_test_loop_scope=function
collected 31 items

tests/unittests/cli/utils/test_cli_deploy.py::test_resolve_project_with_option PASSED                                                                                                                                                                               [  3%]
tests/unittests/cli/utils/test_cli_deploy.py::test_resolve_project_from_gcloud PASSED                                                                                                                                                                               [  6%]
tests/unittests/cli/utils/test_cli_deploy.py::test_resolve_project_from_gcloud_fails PASSED                                                                                                                                                                         [  9%]
tests/unittests/cli/utils/test_cli_deploy.py::test_get_service_option_by_adk_version[1.3.0-sqlite://s-gs://a-rag://m-None---session_service_uri=sqlite://s --artifact_service_uri=gs://a --memory_service_uri=rag://m] PASSED                                       [ 12%]
tests/unittests/cli/utils/test_cli_deploy.py::test_get_service_option_by_adk_version[1.2.5-sqlite://s-gs://a-rag://m-None---session_db_url=sqlite://s --artifact_storage_uri=gs://a] PASSED                                                                         [ 16%]
tests/unittests/cli/utils/test_cli_deploy.py::test_get_service_option_by_adk_version[0.5.0-sqlite://s-gs://a-rag://m-None---session_db_url=sqlite://s] PASSED                                                                                                       [ 19%]
tests/unittests/cli/utils/test_cli_deploy.py::test_get_service_option_by_adk_version[1.3.0-sqlite://s-None-None-None---session_service_uri=sqlite://s] PASSED                                                                                                       [ 22%]
tests/unittests/cli/utils/test_cli_deploy.py::test_get_service_option_by_adk_version[1.3.0-None-gs://a-rag://m-None---artifact_service_uri=gs://a --memory_service_uri=rag://m] PASSED                                                                              [ 25%]
tests/unittests/cli/utils/test_cli_deploy.py::test_get_service_option_by_adk_version[1.2.0-None-gs://a-None-None---artifact_storage_uri=gs://a] PASSED                                                                                                              [ 29%]
tests/unittests/cli/utils/test_cli_deploy.py::test_get_service_option_by_adk_version[1.21.0-None-None-None-False---no_use_local_storage] PASSED                                                                                                                     [ 32%]
tests/unittests/cli/utils/test_cli_deploy.py::test_get_service_option_by_adk_version[1.21.0-None-None-None-True---use_local_storage] PASSED                                                                                                                         [ 35%]
tests/unittests/cli/utils/test_cli_deploy.py::test_get_service_option_by_adk_version[1.21.0-sqlite://s-gs://a-None-False---session_service_uri=sqlite://s --artifact_service_uri=gs://a] PASSED                                                                     [ 38%]
tests/unittests/cli/utils/test_cli_deploy.py::test_agent_engine_app_template_compiles_with_windows_paths PASSED                                                                                                                                                     [ 41%]
tests/unittests/cli/utils/test_cli_deploy.py::test_to_agent_engine_happy_path[True] PASSED                                                                                                                                                                          [ 45%]
tests/unittests/cli/utils/test_cli_deploy.py::test_to_agent_engine_happy_path[False] PASSED                                                                                                                                                                         [ 48%]
tests/unittests/cli/utils/test_cli_deploy.py::test_to_agent_engine_raises_when_explicit_config_file_missing PASSED                                                                                                                                                  [ 51%]
tests/unittests/cli/utils/test_cli_deploy.py::test_to_agent_engine_skips_agent_import_validation_by_default PASSED                                                                                                                                                  [ 54%]
tests/unittests/cli/utils/test_cli_deploy.py::test_to_agent_engine_validates_agent_import_when_enabled PASSED                                                                                                                                                       [ 58%]
tests/unittests/cli/utils/test_cli_deploy.py::test_to_gke_happy_path[True] PASSED                                                                                                                                                                                   [ 61%]
tests/unittests/cli/utils/test_cli_deploy.py::test_to_gke_happy_path[False] PASSED                                                                                                                                                                                  [ 64%]
tests/unittests/cli/utils/test_cli_deploy.py::TestValidateAgentImport::test_skips_config_agents PASSED                                                                                                                                                              [ 67%]
tests/unittests/cli/utils/test_cli_deploy.py::TestValidateAgentImport::test_raises_on_missing_agent_module PASSED                                                                                                                                                   [ 70%]
tests/unittests/cli/utils/test_cli_deploy.py::TestValidateAgentImport::test_raises_on_missing_export PASSED                                                                                                                                                         [ 74%]
tests/unittests/cli/utils/test_cli_deploy.py::TestValidateAgentImport::test_success_with_root_agent_export PASSED                                                                                                                                                   [ 77%]
tests/unittests/cli/utils/test_cli_deploy.py::TestValidateAgentImport::test_success_with_app_export PASSED                                                                                                                                                          [ 80%]
tests/unittests/cli/utils/test_cli_deploy.py::TestValidateAgentImport::test_success_with_relative_imports PASSED                                                                                                                                                    [ 83%]
tests/unittests/cli/utils/test_cli_deploy.py::TestValidateAgentImport::test_raises_on_import_error PASSED                                                                                                                                                           [ 87%]
tests/unittests/cli/utils/test_cli_deploy.py::TestValidateAgentImport::test_raises_on_basellm_import_error PASSED                                                                                                                                                   [ 90%]
tests/unittests/cli/utils/test_cli_deploy.py::TestValidateAgentImport::test_raises_on_syntax_error PASSED                                                                                                                                                           [ 93%]
tests/unittests/cli/utils/test_cli_deploy.py::TestValidateAgentImport::test_cleans_up_sys_modules PASSED                                                                                                                                                            [ 96%]
tests/unittests/cli/utils/test_cli_deploy.py::TestValidateAgentImport::test_restores_sys_path PASSED                                                                                                                                                                [100%]

=========================================================================================================================== 31 passed in 2.48s ============================================================================================================================
```

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

1. Install adk cli from this PR
2. Run `adk deploy agent_engine ... --agent_engine_config_file /nonexistent.json # Failure expected`
3. Run `adk deploy agent_engine ... --agent_engine_config_file agent/config.json # Deployment proceeds if file path is correct`
### 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.
- [n/a] 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.
- [n/a] Any dependent changes have been merged and published in downstream modules.

COPYBARA_INTEGRATE_REVIEW=#5128 from rei-arifi:fix/agent-engine-config-file-missing 0c2f9f7
PiperOrigin-RevId: 895550691
Set mock_process.pid to None in the resource limits test. Without this, the `finally` block in `run_async` attempts to call `os.killpg` with a fallback `Mock` object (which evaluates to True). In some environments like GitHub Actions, this can inadvertently kill the test runner's process group rather than raising a TypeException, causing the CI job to hang indefinitely.

Co-authored-by: Liang Wu <wuliang@google.com>
PiperOrigin-RevId: 895992429
Merge #4966

Co-authored-by: Xuan Yang <xygoogle@google.com>
COPYBARA_INTEGRATE_REVIEW=#4966 from llalitkumarrr:main ff7a846
PiperOrigin-RevId: 896062781
PiperOrigin-RevId: 896063584
Remove extra "would you like to proceed" from ToS message since it is asked later. For checking express eligibility, if the API response is "ELIGIBLE" then it is also considered eligible.

Co-authored-by: Kathy Wu <wukathy@google.com>
PiperOrigin-RevId: 896066249
…nsport, protocol version, and auth headers

Co-authored-by: Kathy Wu <wukathy@google.com>
PiperOrigin-RevId: 896068855
Close #4993

Co-authored-by: George Weale <gweale@google.com>
PiperOrigin-RevId: 896076625
We recently overhauled our MCP Toolbox documentation and moved it to a new domain. This PR propagates that URL change here.

PiperOrigin-RevId: 896118946
Standardize Parameter Names:
- Use `skill_name` instead of `name`.
- Use `file_path` instead of `script_path`.
- Updated `_DEFAULT_SKILL_SYSTEM_INSTRUCTION` system prompt to use `skill_name="<SKILL_NAME>"`.

Flexible Arguments for RunSkillScriptTool:
- Updated schema to allow args to be either a JSON object or a list of strings (`anyOf`).
- Updated `RunSkillScriptTool.run_async` and `_SkillScriptCodeExecutor.execute_script_async` to accept both dict and list types for arguments.
- Modified `_SkillScriptCodeExecutor._build_wrapper_code` to pass list arguments directly as command-line arguments for python and bash scripts.

Improved Error Messages:
- Updated error messages across skills tools to specify the parameter name (e.g., "Argument 'skill_name' is required.").
- Collected all validation error messages.

Type Safety:
- Fixed a TypeError in run_skill_script().

PiperOrigin-RevId: 896602439
* 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
GWeale and others added 29 commits May 15, 2026 11:43
…actions

This change introduces logic to identify events containing requests for tool confirmation or auth credentials. The compaction process will now stop before any such "Human-in-the-Loop" (HITL) events, ensuring that the full context of the interaction is preserved and not summarized away. This applies to both sliding window and token threshold compaction strategies.

Co-authored-by: George Weale <gweale@google.com>
PiperOrigin-RevId: 916108771
`part_to_message_block` iterated `content` char-by-char when a tool
returned it as a plain string (e.g. `LoadSkillResourceTool`'s
`{"content": <file text>}`), producing `"H\ne\nl\nl\no"` instead of
`"Hello"`. Guard the list branch with `isinstance(..., list)` and add
a sibling branch that passes a scalar string through directly, matching
Anthropic's `content: str | list[ContentBlockParam]` shape.

Close #5358

Co-authored-by: George Weale <gweale@google.com>
PiperOrigin-RevId: 916109239
Co-authored-by: Amaad Martin <amaadmartin@google.com>
PiperOrigin-RevId: 916112779
…ack as successful

Previously, an empty `candidates` list without `prompt_feedback` resulted in an `UNKNOWN_ERROR`. This change updates the logic to handle such cases as a successful completion with no generated content, which is valid for certain model interactions like tool-driven turns.

Co-authored-by: George Weale <gweale@google.com>
PiperOrigin-RevId: 916115022
…rt ~8%

Co-authored-by: George Weale <gweale@google.com>
PiperOrigin-RevId: 916195791
…ntTool

AgentTool.run_async only extracted text parts from the inner agent's
response, silently dropping code_execution_result.output and
executable_code.code. Outer agents using an inner agent with a code
executor saw nothing.

Close #5481

Co-authored-by: George Weale <gweale@google.com>
PiperOrigin-RevId: 916196604
Co-authored-by: Kathy Wu <wukathy@google.com>
PiperOrigin-RevId: 916198410
Adds @functools.lru_cache to find_context_parameter so the inspect.signature
+ typing.get_type_hints lookup runs once per function, not on every MCP
confirmation callback or declaration build. No public surface change.

Co-authored-by: George Weale <gweale@google.com>
PiperOrigin-RevId: 916204929
… MCP session creation failure

Co-authored-by: Sasha Sobran <asobran@google.com>
PiperOrigin-RevId: 916220631
* Implements live inference in evaluation_generator.py using Runner.run_live().
* Updates base_eval_service.py, local_eval_service.py to support live mode data structures and connection handling.

Testing: Added unit tests:
* test_generates_inferences_with_user_simulator_live
* test_live_session_manually_triggers_callbacks
* test_live_session_manually_triggers_callbacks_with_tools
* test_perform_inference_with_use_live
* test_perform_inference_single_eval_item_live
* test_perform_inference_single_eval_item_non_live
PiperOrigin-RevId: 916231029
Merge #5655
Closes: #5650

Co-authored-by: Xuan Yang <xygoogle@google.com>
COPYBARA_INTEGRATE_REVIEW=#5655 from jfrometa88:main d74b521
PiperOrigin-RevId: 917231422
…_data_insights tool

PiperOrigin-RevId: 917326615
…tion history passed to user simulator

PiperOrigin-RevId: 917340645
…lock

Merge #5687

Co-authored-by: Xuan Yang <xygoogle@google.com>
COPYBARA_INTEGRATE_REVIEW=#5687 from arpitjain099:ci/add-permissions c145c10
PiperOrigin-RevId: 917369094
Co-authored-by: George Weale <gweale@google.com>
PiperOrigin-RevId: 917411239
- 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
Fixes #5702

Co-authored-by: Xuan Yang <xygoogle@google.com>
PiperOrigin-RevId: 917452441
Merge #5747

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

COPYBARA_INTEGRATE_REVIEW=#5747 from google:release/v1.34.0 160b1b4
PiperOrigin-RevId: 917514751
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>
…uments 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
Change-Id: If39d565130df657d08e4367394c33771e68ad364
Co-authored-by: Sasha Sobran <asobran@google.com>
Co-authored-by: Jacksunwei <1281348+Jacksunwei@users.noreply.github.com>
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
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
@sasha-gitg sasha-gitg closed this May 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.