Skip to content

Commit 67866b1

Browse files
Merge branch 'main' into fix-3458
2 parents 9193be4 + ec660ed commit 67866b1

192 files changed

Lines changed: 15648 additions & 5806 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
name: Mypy New Error Check
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
10+
jobs:
11+
mypy-diff:
12+
runs-on: ubuntu-latest
13+
strategy:
14+
matrix:
15+
python-version: ['3.10', '3.11', '3.12', '3.13',]
16+
steps:
17+
- name: Checkout code
18+
uses: actions/checkout@v4
19+
with:
20+
fetch-depth: 0
21+
22+
- name: Set up Python
23+
uses: actions/setup-python@v5
24+
with:
25+
python-version: ${{ matrix.python-version }}
26+
27+
- name: Install uv
28+
uses: astral-sh/setup-uv@v5
29+
30+
- name: Generate Baseline (Main)
31+
run: |
32+
# Switch to main branch to generate baseline
33+
git checkout origin/main
34+
35+
git checkout ${{ github.sha }} -- pyproject.toml
36+
37+
# Install dependencies for main
38+
uv venv .venv
39+
source .venv/bin/activate
40+
uv sync --all-extras
41+
42+
# Run mypy, filter for errors only, remove line numbers (file:123: -> file::), and sort
43+
# We ignore exit code (|| true) because we expect errors on main
44+
uv run mypy . | grep "error:" | sed 's/:\([0-9]\+\):/::/g' | sort > main_errors.txt || true
45+
46+
echo "Found $(wc -l < main_errors.txt) errors on main."
47+
48+
- name: Check PR Branch
49+
run: |
50+
# Switch back to the PR commit
51+
git checkout ${{ github.sha }}
52+
53+
# Re-sync dependencies in case the PR changed them
54+
source .venv/bin/activate
55+
uv sync --all-extras
56+
57+
# Run mypy on PR code, apply same processing
58+
uv run mypy . | grep "error:" | sed 's/:\([0-9]\+\):/::/g' | sort > pr_errors.txt || true
59+
60+
echo "Found $(wc -l < pr_errors.txt) errors on PR branch."
61+
62+
- name: Compare and Fail on New Errors
63+
run: |
64+
# 'comm -13' suppresses unique lines in file1 (main) and common lines,
65+
# leaving only lines unique to file2 (PR) -> The new errors.
66+
comm -13 main_errors.txt pr_errors.txt > new_errors.txt
67+
68+
if [ -s new_errors.txt ]; then
69+
echo "::error::The following NEW mypy errors were introduced:"
70+
cat new_errors.txt
71+
exit 1
72+
else
73+
echo "Great job! No new mypy errors introduced."
74+
fi

.github/workflows/mypy.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Mypy Type Check
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
mypy:
11+
runs-on: ubuntu-latest
12+
strategy:
13+
matrix:
14+
python-version: ['3.10', '3.11', '3.12', '3.13',]
15+
16+
steps:
17+
- uses: actions/checkout@v4
18+
19+
- name: Install uv
20+
uses: astral-sh/setup-uv@v1
21+
22+
- name: Set up Python
23+
uses: actions/setup-python@v5
24+
with:
25+
python-version: ${{ matrix.python-version }}
26+
27+
- name: Install dependencies
28+
run: uv sync --all-extras
29+
30+
- name: Run mypy
31+
32+
run: uv run mypy . --strict

CHANGELOG.md

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,97 @@
11
# Changelog
22

3+
## [1.24.1](https://github.com/google/adk-python/compare/v1.24.0...v1.24.1) (2026-02-06)
4+
5+
### Bug Fixes
6+
7+
* Add back deprecated eval endpoint for web until we migrate([ae993e8](https://github.com/google/adk-python/commit/ae993e884f44db276a4116ebb7a11a2fb586dbfe))
8+
* Update eval dialog colors, and fix a2ui component types ([3686a3a](https://github.com/google/adk-python/commit/3686a3a98f46738549cd7a999f3773b7a6fd1182))
9+
10+
## [1.24.0](https://github.com/google/adk-python/compare/v1.23.0...v1.24.0) (2026-02-04)
11+
12+
### ⚠ BREAKING CHANGES
13+
14+
* Breaking: Make credential manager accept `tool_context` instead of `callback_context` ([fe82f3c](https://github.com/google/adk-python/commit/fe82f3cde854e49be13d90b4c02d786d82f8a202))
15+
16+
### Highlights
17+
18+
* **[Web]**
19+
* **Consolidated Event View**: Replaced the Event tab with a more intuitive "click-to-expand" interaction on message rows, enabling faster debugging within the chat context
20+
* **Enhanced Accessibility**: Added full support for arrow-key navigation for a more seamless, keyboard-centric experience
21+
* **Rich Developer Tooling**: Introduced detailed tooltips for function calls, providing instant visibility into arguments, responses, and state changes
22+
* **A2UI Integration**: Integrated the **A2UI v0.8** standard catalog to automatically render spec-compliant ADK parts as native UI components directly in the chat
23+
24+
### Features
25+
26+
* **[Core]**
27+
* Allow passthrough of `GOOGLE_CLOUD_LOCATION` for Agent Engine deployments ([004e15c](https://github.com/google/adk-python/commit/004e15ccb7c7f683623f8e7d2e77a9d12558c545))
28+
* Add interface for agent optimizers ([4ee125a](https://github.com/google/adk-python/commit/4ee125a03856fdb9ed28245bf7f5917c2d9038db))
29+
* Pass event ID as metadata when converted into a message ([85434e2](https://github.com/google/adk-python/commit/85434e293f7bd1e3711f190f84d5a36804e4462b))
30+
* Restructure the bug report template as per the intake process ([324796b](https://github.com/google/adk-python/commit/324796b4fe05bec3379bfef67071a29552ef355a))
31+
32+
* **[Models]**
33+
* Mark Vertex calls made from non-Gemini models ([7d58e0d](https://github.com/google/adk-python/commit/7d58e0d2f375bc80bdfac9cffea2926fd2344b8a))
34+
35+
* **[Evals]**
36+
* Allow Vertex AI Client initialization with API Key ([43d6075](https://github.com/google/adk-python/commit/43d6075ea7aa49ddb358732f2219ca9598dd286f))
37+
* Remove overall evaluation status calculation from `_CustomMetricEvaluator` and add threshold to custom metric function expected signature ([553e376](https://github.com/google/adk-python/commit/553e376718ceb3d7fb1403231bb720836d71f42c))
38+
39+
* **[Tools]**
40+
* Make OpenAPI tool asynchronous ([9290b96](https://github.com/google/adk-python/commit/9290b966267dc02569786f95aab2a3cb78c7004f))
41+
* Implement toolset authentication for `McpToolset`, `OpenAPIToolset`, and other toolsets ([798f65d](https://github.com/google/adk-python/commit/798f65df86b1bbe33d864e30c5b1f9e155e89810))
42+
* Add framework support for toolset authentication before `get_tools` calls ([ee873ca](https://github.com/google/adk-python/commit/ee873cae2e2df960910d264a4340ce6c0489eb7a))
43+
* Support dynamic configuration for `VertexAiSearchTool` ([585ebfd](https://github.com/google/adk-python/commit/585ebfdac7f1b8007b4e4a7e4258ec5de72c78b1))
44+
* Add `get_auth_config` method to toolset to expose authentication requirements ([381d44c](https://github.com/google/adk-python/commit/381d44cab437cac027af181ae627e7b260b7561e))
45+
* Add methods in `McpToolset` for users to access MCP resources ([8f7d965](https://github.com/google/adk-python/commit/8f7d9659cfc19034af29952fbca765d012169b38))
46+
* Improve error message when failing to get tools from MCP ([3480b3b](https://github.com/google/adk-python/commit/3480b3b82d89de69f77637d7ad034827434df45a))
47+
48+
* **[Services]**
49+
* Improve `asyncio` loop handling and test cleanup ([00aba2d](https://github.com/google/adk-python/commit/00aba2d884d24fb5244d1de84f8dba9cbc3c07e8))
50+
51+
* **[Live]**
52+
* Support running tools in separate threads for live mode ([714c3ad](https://github.com/google/adk-python/commit/714c3ad0477e775fba6696a919a366a293197268))
53+
54+
* **[Observability]**
55+
* Add extra attributes to spans generated with `opentelemetry-instrumentation-google-genai` ([e87a843](https://github.com/google/adk-python/commit/e87a8437fb430e0d4c42c73948e3ba1872040a15))
56+
57+
### Bug Fixes
58+
59+
* Ignore `session_db_kwargs` for SQLite session services ([ce07cd8](https://github.com/google/adk-python/commit/ce07cd8144c8498434f68e61ebeb519bf329f778))
60+
* Resolve `MutualTLSChannelError` by adding `pyopenssl` dependency ([125bc85](https://github.com/google/adk-python/commit/125bc85ac5e1400bc38f7c681f76fa82626c9911))
61+
* Add `update_timestamp_tz` property to `StorageSession` ([666cebe](https://github.com/google/adk-python/commit/666cebe3693d2981fd5fea6e9e4c65e56dcd3f2b))
62+
* Do not treat Function Calls and Function Responses as invisible when marked as thoughts ([853a3b0](https://github.com/google/adk-python/commit/853a3b0e143ce27516f0de51e0e0df2af6ecf465))
63+
* Add pre-deployment validation for agent module imports (credit to @ppgranger, [2ac468e](https://github.com/google/adk-python/commit/2ac468ea7e30ef30c1324ffc86f67dbf32ab7ede))
64+
* Fix cases where `execution_result_delimiters` have `None` type element ([a16e3cc](https://github.com/google/adk-python/commit/a16e3cc67e1cb391228ba78662547672404ae550))
65+
* Disable `save_input_blobs_as_artifacts` deprecation warning message for users not setting it ([c34615e](https://github.com/google/adk-python/commit/c34615ecf3c7bbe0f4275f72543774f258c565b4))
66+
* Fix agent config path handling in generated deployment script ([8012339](https://github.com/google/adk-python/commit/801233902bbd6c0cca63b6fc8c1b0b2531f3f11e))
67+
* Add `pypika>=0.50.0` to `project.toml` to support `crewai` on Python 3.12+ ([e8f7aa3](https://github.com/google/adk-python/commit/e8f7aa3140d2585ac38ebfe31c5b650383499a20))
68+
* Update OpenTelemetry dependency versions to relax version constraints for `opentelemetry-api` and `opentelemetry-sdk` ([706a6dd](https://github.com/google/adk-python/commit/706a6dda8144da147bd9fa42ef85bbfa58fec5d3))
69+
* Enable `pool_pre_ping` by default for non-SQLite database engines ([da73e71](https://github.com/google/adk-python/commit/da73e718efa9557ed33e2fb579de68fcbcf4c7f0))
70+
* Ensure database sessions are always rolled back on errors ([63a8eba](https://github.com/google/adk-python/commit/63a8eba53f2cb07625eb7cd111ff767e8e0030fa))
71+
* Reload stale session in `DatabaseSessionService` when storage update time is later than the in-memory session object ([1063fa5](https://github.com/google/adk-python/commit/1063fa532cad59d8e9f7421ce2f523724d49d541))
72+
* Make credential key generation stable and prevent cross-user credential leaks ([33012e6](https://github.com/google/adk-python/commit/33012e6dda9ef20c7a1dae66a84717de5d782097))
73+
* Change MCP `read_resource` to return original contents ([ecce7e5](https://github.com/google/adk-python/commit/ecce7e54a688a915a1b9d742c39e4684186729be))
74+
* Recognize function responses as non-empty parts in LiteLLM ([d0102ec](https://github.com/google/adk-python/commit/d0102ecea331e062190dbb7578a4ef7f4044306e))
75+
* Handle HTTP/HTTPS URLs for media files in LiteLLM content conversion ([47221cd](https://github.com/google/adk-python/commit/47221cd5c1e778cd4b92ed8d382c639435f5728c))
76+
* Fix Pydantic schema generation error for `ClientSession` ([131fbd3](https://github.com/google/adk-python/commit/131fbd39482980572487a30fea13236d2badd543))
77+
* Fix Click’s Wrapping in `adk eval` help message ([3bcd8f7](https://github.com/google/adk-python/commit/3bcd8f7f7a0683f838005bc209f7d39dc93f850b))
78+
* Stream errors as simple JSON objects in ADK web server SSE endpoint ([798d005](https://github.com/google/adk-python/commit/798d0053c832e7ed52e2e104f8a14f789ba8b17f))
79+
* Remove print debugging artifact ([0d38a36](https://github.com/google/adk-python/commit/0d38a3683f13bc12dc5d181164b6cd5d72fc260c))
80+
81+
### Improvements
82+
83+
* Check `will_continue` for streaming function calls ([2220d88](https://github.com/google/adk-python/commit/2220d885cda875144b52338b5becf6e5546f3f51))
84+
* Update ADK web, rework events, and add A2UI capabilities ([37e6507](https://github.com/google/adk-python/commit/37e6507ce4d8750100d914eb1a62014350ef1795))
85+
* Improve error handling for LiteLLM import in `gemma_llm.py` ([574ec43](https://github.com/google/adk-python/commit/574ec43a175e3bf3a05e73114e8db7196fae7040))
86+
* Replace proxy methods with utils implementation ([6ff10b2](https://github.com/google/adk-python/commit/6ff10b23be01c1f7dd79d13ac8c679c079140f76), [f82ceb0](https://github.com/google/adk-python/commit/f82ceb0ce75d3efed7c046835ddac76c28210013))
87+
* Replace print statements with logging in ADK evaluation components ([dd8cd27](https://github.com/google/adk-python/commit/dd8cd27b2ce505ecca50cdfbb1469db01c82b0af))
88+
* Add sample agent that requires OAuth flow during MCP tool listing, and convert `MCPToolset` to `McpToolset` in unit tests ([2770012](https://github.com/google/adk-python/commit/2770012cecdfc71628a818a75b21faabe828b4e5), [4341839](https://github.com/google/adk-python/commit/43418394202c2d01b0d37f6424bd601148077e27))
89+
* Ensure `BigQueryAgentAnalyticsPlugin` is shut down after each test ([c0c98d9](https://github.com/google/adk-python/commit/c0c98d94b3161d6bf9fff731e0abfc985b53e653))
90+
* Add ADK logger in `RestApiTool` ([288c2c4](https://github.com/google/adk-python/commit/288c2c448d77c574dafadf7851a49e6ff59fa7f4))
91+
* Add GitHub Action check to run `mypy` ([32f9f92](https://github.com/google/adk-python/commit/32f9f92042ab530220ac9d159045c91d311affa7))
92+
* Add `unittests.sh` script and update `CONTRIBUTING.md` ([025b42c](https://github.com/google/adk-python/commit/025b42c8361ad2078593e3e7fc5301df88a532c7))
93+
* Extract helper function for LLM request building and response processing ([753084f](https://github.com/google/adk-python/commit/753084fd46c9637488f33b0a05b4d270f6e03a39))
94+
395
## [1.23.0](https://github.com/google/adk-python/compare/v1.22.1...v1.23.0) (2026-01-22)
496

597
### ⚠ BREAKING CHANGES

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ root_agent = Agent(
115115

116116
### Define a multi-agent system:
117117

118-
Define a multi-agent system with coordinator agent, greeter agent, and task execution agent. Then ADK engine and the model will guide the agents works together to accomplish the task.
118+
Define a multi-agent system with coordinator agent, greeter agent, and task execution agent. Then ADK engine and the model will guide the agents to work together to accomplish the task.
119119

120120
```python
121121
from google.adk.agents import LlmAgent, BaseAgent

contributing/samples/adk_documentation/adk_release_analyzer/agent.py

Lines changed: 26 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,25 @@
5757
from google.adk.agents.loop_agent import LoopAgent
5858
from google.adk.agents.readonly_context import ReadonlyContext
5959
from google.adk.agents.sequential_agent import SequentialAgent
60+
from google.adk.models import Gemini
6061
from google.adk.tools.exit_loop_tool import exit_loop
6162
from google.adk.tools.tool_context import ToolContext
63+
from google.genai import types
64+
65+
# Retry configuration for handling API rate limits and overload
66+
_RETRY_OPTIONS = types.HttpRetryOptions(
67+
initial_delay=10,
68+
attempts=8,
69+
exp_base=2,
70+
max_delay=300,
71+
http_status_codes=[429, 503],
72+
)
73+
74+
# Use gemini-3-pro-preview for planning and summary (better quality)
75+
GEMINI_PRO_WITH_RETRY = Gemini(
76+
model="gemini-3-pro-preview",
77+
retry_options=_RETRY_OPTIONS,
78+
)
6279

6380
# Maximum number of files per analysis group to avoid context overflow
6481
MAX_FILES_PER_GROUP = 5
@@ -249,7 +266,7 @@ def get_release_context(tool_context: ToolContext) -> dict[str, Any]:
249266
# =============================================================================
250267

251268
planner_agent = Agent(
252-
model="gemini-2.5-pro",
269+
model=GEMINI_PRO_WITH_RETRY,
253270
name="release_planner",
254271
description=(
255272
"Plans the analysis by fetching release info and organizing files into"
@@ -272,12 +289,12 @@ def get_release_context(tool_context: ToolContext) -> dict[str, Any]:
272289
273290
3. Call `get_changed_files_summary` to get the list of changed files WITHOUT
274291
the full patches (to save context space).
275-
- **IMPORTANT**: Pass `local_repo_path="{LOCAL_REPOS_DIR_PATH}/{CODE_REPO}"`
276-
to use local git and avoid GitHub API's 300-file limit.
292+
- **IMPORTANT**: Pass these parameters:
293+
- `local_repo_path="{LOCAL_REPOS_DIR_PATH}/{CODE_REPO}"` to avoid 300-file limit
294+
- `path_filter="src/google/adk/"` to only get ADK source files (reduces token usage)
277295
278-
4. Filter and organize the files:
279-
- **INCLUDE** only files in `src/google/adk/` directory
280-
- **EXCLUDE** test files, `__init__.py`, and files outside src/
296+
4. Further filter the returned files:
297+
- **EXCLUDE** test files and `__init__.py` files
281298
- **IMPORTANT**: Do NOT exclude any file just because it has few changes.
282299
Even single-line changes to public APIs need documentation updates.
283300
- **PRIORITIZE** by importance:
@@ -423,7 +440,7 @@ def file_analyzer_instruction(readonly_context: ReadonlyContext) -> str:
423440

424441

425442
file_group_analyzer = Agent(
426-
model="gemini-2.5-pro",
443+
model=GEMINI_PRO_WITH_RETRY,
427444
name="file_group_analyzer",
428445
description=(
429446
"Analyzes a group of changed files and generates recommendations."
@@ -507,7 +524,7 @@ def summary_instruction(readonly_context: ReadonlyContext) -> str:
507524

508525

509526
summary_agent = Agent(
510-
model="gemini-2.5-pro",
527+
model=GEMINI_PRO_WITH_RETRY,
511528
name="summary_agent",
512529
description="Compiles recommendations and creates the GitHub issue.",
513530
instruction=summary_instruction,
@@ -542,7 +559,7 @@ def summary_instruction(readonly_context: ReadonlyContext) -> str:
542559
# =============================================================================
543560

544561
root_agent = Agent(
545-
model="gemini-2.5-pro",
562+
model=GEMINI_PRO_WITH_RETRY,
546563
name="adk_release_analyzer",
547564
description=(
548565
"Analyzes ADK Python releases and generates documentation update"

contributing/samples/adk_documentation/tools.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -605,6 +605,7 @@ def get_changed_files_summary(
605605
start_tag: str,
606606
end_tag: str,
607607
local_repo_path: Optional[str] = None,
608+
path_filter: Optional[str] = None,
608609
) -> Dict[str, Any]:
609610
"""Gets a summary of changed files between two releases without patches.
610611
@@ -620,14 +621,17 @@ def get_changed_files_summary(
620621
local_repo_path: Optional absolute path to local git repo. If provided
621622
and valid, uses git diff instead of GitHub API to get complete
622623
file list (avoids 300-file limit).
624+
path_filter: Optional path prefix to filter files. Only files whose
625+
path starts with this prefix will be included. Example:
626+
"src/google/adk/" to only include ADK source files.
623627
624628
Returns:
625629
A dictionary containing the status and a summary of changed files.
626630
"""
627631
# Use local git if valid path is provided (avoids GitHub API 300-file limit)
628632
if local_repo_path and os.path.isdir(os.path.join(local_repo_path, ".git")):
629633
return _get_changed_files_from_local_git(
630-
local_repo_path, start_tag, end_tag, repo_owner, repo_name
634+
local_repo_path, start_tag, end_tag, repo_owner, repo_name, path_filter
631635
)
632636

633637
# Fall back to GitHub API (limited to 300 files)
@@ -689,6 +693,7 @@ def _get_changed_files_from_local_git(
689693
end_tag: str,
690694
repo_owner: str,
691695
repo_name: str,
696+
path_filter: Optional[str] = None,
692697
) -> Dict[str, Any]:
693698
"""Gets changed files using local git commands (no file limit).
694699
@@ -698,6 +703,7 @@ def _get_changed_files_from_local_git(
698703
end_tag: The newer tag (head) for the comparison.
699704
repo_owner: Repository owner for compare URL.
700705
repo_name: Repository name for compare URL.
706+
path_filter: Optional path prefix to filter files.
701707
702708
Returns:
703709
A dictionary containing the status and a summary of changed files.
@@ -766,6 +772,10 @@ def _get_changed_files_from_local_git(
766772
status_code = parts[0][0] # First char is the status
767773
filename = parts[-1] # Last part is filename (handles renames)
768774

775+
# Apply path filter if specified
776+
if path_filter and not filename.startswith(path_filter):
777+
continue
778+
769779
stats = file_stats.get(
770780
filename,
771781
{

contributing/samples/adk_issue_formatting_agent/agent.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ def add_comment_to_issue(issue_number: int, comment: str) -> dict[str, any]:
9696
comment: comment to add
9797
9898
Returns:
99-
The the status of this request, with the applied comment when successful.
99+
The status of this request, with the applied comment when successful.
100100
"""
101101
print(f"Attempting to add comment '{comment}' to issue #{issue_number}")
102102
url = f"{GITHUB_BASE_URL}/repos/{OWNER}/{REPO}/issues/{issue_number}/comments"
@@ -119,7 +119,7 @@ def list_comments_on_issue(issue_number: int) -> dict[str, any]:
119119
issue_number: issue number of the GitHub issue
120120
121121
Returns:
122-
The the status of this request, with the list of comments when successful.
122+
The status of this request, with the list of comments when successful.
123123
"""
124124
print(f"Attempting to list comments on issue #{issue_number}")
125125
url = f"{GITHUB_BASE_URL}/repos/{OWNER}/{REPO}/issues/{issue_number}/comments"

0 commit comments

Comments
 (0)