- Treat Part(thought=True) as reasoning_content when building assistant messages.
- Add unit tests for thought-only and thought+text cases.
Close#4069
Co-authored-by: George Weale <gweale@google.com>
PiperOrigin-RevId: 853790274
Default session and artifact services to in-memory when running in Cloud Run/Kubernetes (or when agents_dir isn’t writable) to prevent startup failures from attempting to create .adk under read-only/unwritable container paths (e.g. /app/agents/.adk). Local development defaults are unchanged.
- ADK_FORCE_LOCAL_STORAGE=1 to always use .adk defaults
- ADK_DISABLE_LOCAL_STORAGE=1 to always avoid local storage
If local artifact initialization raises PermissionError, fall back to in-memory and log a warning
Close#3907
Co-authored-by: George Weale <gweale@google.com>
PiperOrigin-RevId: 853315459
LlmAgent now resolves model from ancestors or a system default (gemini-2.5-flash) when unset. Added LlmAgent.set_default_model() to override the default globally
Co-authored-by: George Weale <gweale@google.com>
PiperOrigin-RevId: 853006116
The `adk create` command now checks if the provided agent name is a valid Python identifier. An invalid name, such as one containing hyphens, will raise a `click.BadParameter` error before any files are created.
Close#3977
Co-authored-by: George Weale <gweale@google.com>
PiperOrigin-RevId: 853001295
This change introduces a `_sanitize_schema_types` method to the OpenAPI spec parser. This method recursively removes or filters out non-standard schema types (e.g., "Any", "Unknown") from the OpenAPI specification
Close#3704Close#3108
Co-authored-by: George Weale <gweale@google.com>
PiperOrigin-RevId: 852986491
Final part of https://github.com/google/adk-python/discussions/3605.
This change introduces:
- A new `adk migrate session` CLI command to run database schema upgrades.
- A migration script to upgrade from the old Pickle-based session schema (v0) to the new JSON-based schema (v1).
- A migration runner that orchestrates the upgrade process, handling sequential migrations and using temporary SQLite databases for intermediate steps if needed.
- Unit tests for the v0 to v1 migration.
Co-authored-by: Liang Wu <wuliang@google.com>
PiperOrigin-RevId: 852983323
This change modifies `load_dotenv_for_agent` to first capture the environment variables already set in the process. After loading the `.env` file with `override=True`, it restores the values of these initially set variables, ensuring that explicitly set environment variables are not overwritten by the `.env` file. A new environment variable, `ADK_DISABLE_LOAD_DOTENV`, is also introduced to completely skip the `.env` loading process
Close#4020
Close $4018
Co-authored-by: George Weale <gweale@google.com>
PiperOrigin-RevId: 852981654
Thought parts represent internal model reasoning and should not be included in the content sent back to the model in subsequent turns
Close#3948
Co-authored-by: George Weale <gweale@google.com>
PiperOrigin-RevId: 852965417
This change modifies the /run_sse endpoint to split events that contain both content and an artifactDelta. The original event is split into two separate SSE events: one containing only the content (with artifactDelta cleared) and another containing only the artifactDelta (with content cleared)
Close#4036
Co-authored-by: George Weale <gweale@google.com>
PiperOrigin-RevId: 852945249
The _load_existing_credential method in CredentialManager will now only attempt to load credentials from the credential service and will no longer check the AuthConfig's exchanged_auth_credential cache.
Close#3772
Co-authored-by: George Weale <gweale@google.com>
PiperOrigin-RevId: 852944533
The retry_on_errors decorator in mcp_session_manager.py now catches asyncio.CancelledError and re-raises it immediately, ensuring that cancellation requests are not suppressed or retried
Close#4009
Co-authored-by: George Weale <gweale@google.com>
PiperOrigin-RevId: 852468382
The `model_dump_json()` method already returns a JSON string, so wrapping it in `json.dumps()` was causing double encoding
Close#3993
Co-authored-by: George Weale <gweale@google.com>
PiperOrigin-RevId: 852455534
Adds a method to merge custom metadata from the RunConfig into each Event. This metadata is applied to events generated by the agent, early exit events, and the initial user message event.
Close#3953
Co-authored-by: George Weale <gweale@google.com>
PiperOrigin-RevId: 852433171
These changes add extra hint for the LLM in the `execute_tool` SQL examples to always use back-ticks around BQ project, dataset and table names in the generated SQL, to save the SQL parsing error when the name has special characters.
PiperOrigin-RevId: 852418943
Adds a Pydantic field validator to ToolTrajectoryCriterion to automatically convert string inputs for the match_type field into the corresponding MatchType enum member
Close#3711
Co-authored-by: George Weale <gweale@google.com>
PiperOrigin-RevId: 852415560
The change updates the `StorageEvent.to_event` method to use `EventActions.model_validate` when rehydrating the `actions` field. This ensures that nested models within `EventActions`, such as `EventCompaction`, are correctly reconstructed from the stored data
Close#4047
Co-authored-by: George Weale <gweale@google.com>
PiperOrigin-RevId: 852408683
When truncating conversation history, make sure function_response messages always have their corresponding function_call included
Close#4027
Co-authored-by: George Weale <gweale@google.com>
PiperOrigin-RevId: 852377919
- Add path-safe helpers so all builder filesystem operations stay under <agents_dir>/<app_name> and reject traversal/invalid upload paths.
- Rework /builder/save to support tmp=true writes under <app>/tmp/<app>, promote tmp → app root on final save (preserving tools.py/tools/), then clean up tmp on success.
- Simplify /builder/app/{app_name}/cancel to best-effort delete tmp; update GET /builder/app/{app_name}?tmp=true to auto-recreate tmp from the app root and safely serve requested files.
Co-authored-by: George Weale <gweale@google.com>
PiperOrigin-RevId: 852366567