Skip to content

Commit 524dc29

Browse files
Merge branch 'main' into fix-genai-parts
2 parents 4296f05 + 004e15c commit 524dc29

File tree

96 files changed

+6875
-1608
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

96 files changed

+6875
-1608
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 51 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -7,34 +7,69 @@ assignees: ''
77

88
---
99

10-
** Please make sure you read the contribution guide and file the issues in the right place. **
11-
[Contribution guide.](https://google.github.io/adk-docs/contributing-guide/)
10+
## 🔴 Required Information
11+
*Please ensure all items in this section are completed to allow for efficient
12+
triaging. Requests without complete information may be rejected / deprioritized.
13+
If an item is not applicable to you - please mark it as N/A*
1214

13-
**Describe the bug**
15+
**Describe the Bug:**
1416
A clear and concise description of what the bug is.
1517

16-
**To Reproduce**
17-
Please share a minimal code and data to reproduce your problem.
18-
Steps to reproduce the behavior:
18+
**Steps to Reproduce:**
19+
Please provide a numbered list of steps to reproduce the behavior:
1920
1. Install '...'
2021
2. Run '....'
2122
3. Open '....'
2223
4. Provide error or stacktrace
2324

24-
**Expected behavior**
25+
**Expected Behavior:**
2526
A clear and concise description of what you expected to happen.
2627

27-
**Screenshots**
28-
If applicable, add screenshots to help explain your problem.
28+
**Observed Behavior:**
29+
What actually happened? Include error messages or crash stack traces here.
2930

30-
**Desktop (please complete the following information):**
31-
- OS: [e.g. macOS, Linux, Windows]
32-
- Python version(python -V):
33-
- ADK version(pip show google-adk):
31+
**Environment Details:**
32+
33+
- ADK Library Version (pip show google-adk):
34+
- Desktop OS:** [e.g., macOS, Linux, Windows]
35+
- Python Version (python -V):
36+
37+
**Model Information:**
3438

35-
**Model Information:**
3639
- Are you using LiteLLM: Yes/No
37-
- Which model is being used(e.g. gemini-2.5-pro)
40+
- Which model is being used: (e.g., gemini-2.5-pro)
41+
42+
---
43+
44+
## 🟡 Optional Information
45+
*Providing this information greatly speeds up the resolution process.*
46+
47+
**Regression:**
48+
Did this work in a previous version of ADK? If so, which one?
3849

39-
**Additional context**
50+
**Logs:**
51+
Please attach relevant logs. Wrap them in code blocks (```) or attach a
52+
text file.
53+
```text
54+
// Paste logs here
55+
```
56+
57+
**Screenshots / Video:**
58+
If applicable, add screenshots or screen recordings to help explain
59+
your problem.
60+
61+
**Additional Context:**
4062
Add any other context about the problem here.
63+
64+
**Minimal Reproduction Code:**
65+
Please provide a code snippet or a link to a Gist/repo that isolates the issue.
66+
```python
67+
// Code snippet here
68+
```
69+
70+
**How often has this issue occurred?:**
71+
72+
- Always (100%)
73+
- Often (50%+)
74+
- Intermittently (<50%)
75+
- Once / Rare

.github/ISSUE_TEMPLATE/feature_request.md

Lines changed: 33 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,39 @@ assignees: ''
1010
** Please make sure you read the contribution guide and file the issues in the right place. **
1111
[Contribution guide.](https://google.github.io/adk-docs/contributing-guide/)
1212

13-
**Is your feature request related to a problem? Please describe.**
14-
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
13+
## 🔴 Required Information
14+
*Please ensure all items in this section are completed to allow for efficient
15+
triaging. Requests without complete information may be rejected / deprioritized.
16+
If an item is not applicable to you - please mark it as N/A*
1517

16-
**Describe the solution you'd like**
17-
A clear and concise description of what you want to happen.
18+
### Is your feature request related to a specific problem?
19+
Please describe the problem you are trying to solve. (Ex: "I'm always frustrated
20+
when I have to manually handle X...")
1821

19-
**Describe alternatives you've considered**
20-
A clear and concise description of any alternative solutions or features you've considered.
22+
### Describe the Solution You'd Like
23+
A clear and concise description of the feature or API change you want.
24+
Be specific about input/outputs if this involves an API change.
2125

22-
**Additional context**
23-
Add any other context or screenshots about the feature request here.
26+
### Impact on your work
27+
How does this feature impact your work and what are you trying to achieve?
28+
If this is critical for you, tell us if there is a timeline by when you need
29+
this feature.
30+
31+
### Willingness to contribute
32+
Are you interested in implementing this feature yourself or submitting a PR?
33+
(Yes/No)
34+
35+
---
36+
37+
## 🟡 Recommended Information
38+
39+
### Describe Alternatives You've Considered
40+
A clear and concise description of any alternative solutions or workarounds
41+
you've considered and why they didn't work for you.
42+
43+
### Proposed API / Implementation
44+
If you have ideas on how this should look in code, please share a
45+
pseudo-code example.
46+
47+
### Additional Context
48+
Add any other context or screenshots about the feature request here.
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: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@
55
### ⚠ BREAKING CHANGES
66

77
* Breaking: Use OpenTelemetry for BigQuery plugin tracing, replacing custom `ContextVar` implementation ([ab89d12](https://github.com/google/adk-python/commit/ab89d1283430041afb303834749869e9ee331721))
8-
* Add support to automatically create a session if one does not exist ([8e69a58](https://github.com/google/adk-python/commit/8e69a58df4eadeccbb100b7264bb518a46b61fd7))
98

109
### Features
1110

1211
* **[Core]**
12+
* Add support to automatically create a session if one does not exist ([8e69a58](https://github.com/google/adk-python/commit/8e69a58df4eadeccbb100b7264bb518a46b61fd7))
1313
* Remove `@experimental` decorator from `AgentEngineSandboxCodeExecutor` ([135f763](https://github.com/google/adk-python/commit/135f7633253f6a415302142abc3579b664601d5b))
1414
* Add `--disable_features` CLI option to override default feature enable state ([53b67ce](https://github.com/google/adk-python/commit/53b67ce6340f3f3f8c3d732f9f7811e445c76359))
1515
* Add `otel_to_cloud` flag to `adk deploy agent_engine` command ([21f63f6](https://github.com/google/adk-python/commit/21f63f66ee424501d9a70806277463ef718ae843))

CONTRIBUTING.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,18 @@ part before or alongside your code PR.
188188
pytest ./tests/unittests
189189
```
190190

191+
**Alternatively**, use the included `unittests.sh` script which handles
192+
environment setup and restoration automatically:
193+
194+
```shell
195+
./scripts/unittests.sh
196+
```
197+
198+
This script will:
199+
- Set up the test environment with minimal dependencies (`test`, `eval`, `a2a`)
200+
- Run the unit tests
201+
- Restore the full development environment (`--all-extras`)
202+
191203
6. **Auto-format the code:**
192204

193205
**NOTE**: We use `isort` and `pyink` for styles. Use the included

contributing/samples/adk_documentation/adk_release_analyzer/agent.py

Lines changed: 26 additions & 7 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,10 +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).
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)
275295
276-
4. Filter and organize the files:
277-
- **INCLUDE** only files in `src/google/adk/` directory
278-
- **EXCLUDE** test files, `__init__.py`, and files outside src/
296+
4. Further filter the returned files:
297+
- **EXCLUDE** test files and `__init__.py` files
279298
- **IMPORTANT**: Do NOT exclude any file just because it has few changes.
280299
Even single-line changes to public APIs need documentation updates.
281300
- **PRIORITIZE** by importance:
@@ -421,7 +440,7 @@ def file_analyzer_instruction(readonly_context: ReadonlyContext) -> str:
421440

422441

423442
file_group_analyzer = Agent(
424-
model="gemini-2.5-pro",
443+
model=GEMINI_PRO_WITH_RETRY,
425444
name="file_group_analyzer",
426445
description=(
427446
"Analyzes a group of changed files and generates recommendations."
@@ -505,7 +524,7 @@ def summary_instruction(readonly_context: ReadonlyContext) -> str:
505524

506525

507526
summary_agent = Agent(
508-
model="gemini-2.5-pro",
527+
model=GEMINI_PRO_WITH_RETRY,
509528
name="summary_agent",
510529
description="Compiles recommendations and creates the GitHub issue.",
511530
instruction=summary_instruction,
@@ -540,7 +559,7 @@ def summary_instruction(readonly_context: ReadonlyContext) -> str:
540559
# =============================================================================
541560

542561
root_agent = Agent(
543-
model="gemini-2.5-pro",
562+
model=GEMINI_PRO_WITH_RETRY,
544563
name="adk_release_analyzer",
545564
description=(
546565
"Analyzes ADK Python releases and generates documentation update"

0 commit comments

Comments
 (0)