- 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
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
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
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
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
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
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
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
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
* 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
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
We recently overhauled our MCP Toolbox documentation and moved it to a new domain. This PR propagates that URL change here.
PiperOrigin-RevId: 896118946
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
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 https://github.com/google/adk-python/pull/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=https://github.com/google/adk-python/pull/5128 from rei-arifi:fix/agent-engine-config-file-missing 0c2f9f7b2f7f2e681f7d814637204a113047d95a
PiperOrigin-RevId: 895550691
- 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
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
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
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
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