Skip to content

[pull] main from google:main#401

Merged
pull[bot] merged 15 commits into
CrazyForks:mainfrom
google:main
Jul 6, 2026
Merged

[pull] main from google:main#401
pull[bot] merged 15 commits into
CrazyForks:mainfrom
google:main

Conversation

@pull

@pull pull Bot commented Jul 6, 2026

Copy link
Copy Markdown

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.4)

Can you help keep this open source service alive? 💖 Please sponsor : )

GWeale and others added 15 commits July 6, 2026 09:59
The instruction told the model to use a `log_query` tool that is not
registered on the agent, so when the model followed it the run failed
with "Tool 'log_query' not found". That made the integration_test
presubmit, which runs this sample, flaky. Reword the instruction to
just reply, matching the sample's documented output.

Co-authored-by: George Weale <gweale@google.com>
PiperOrigin-RevId: 943350141
Merge #5523

Closes #5486

## Summary

This PR fixes Windows handling of local `file://` artifact URIs.

Both `google/adk/cli/service_registry.py` and `google/adk/artifacts/file_artifact_service.py` were passing URI-style paths into `Path(...)` without Windows URI-to-filesystem normalization. On Windows, this can produce malformed drive-relative paths such as `C:foo` instead of absolute paths like `C:\foo`.

This change applies `url2pathname()` under `os.name == "nt"` in both locations so canonical file URIs like `file:///C:/...` are converted to proper native Windows paths before constructing `Path(...)`.

## Validation

Manually tested on Windows with:

1. current working directory on `C:` and artifact target on `C:`
   - before the patch, the bug reproduced and the artifact root was created in the wrong location
   - after the patch, the artifact root was created in the intended location

2. current working directory on `C:` and artifact target on `D:`
   - before the patch, the current code could appear to work
   - after the patch, it still worked, now through correct URI-to-path normalization

3. paths containing spaces
   - after the patch, the artifact root was created correctly in the intended directory

I also verified the drive-relative behavior separately with:

```python
import ntpath

print(ntpath.abspath("C:foo"))
print(ntpath.abspath("D:foo"))
```

With current working directory `C:\Users\user1\projects\agent1`, this produced:

```text
C:\Users\user1\projects\agent1\foo
D:\foo
```

This matches the observed issue: without Windows-specific normalization, the malformed URI-derived path can behave like a drive-relative path such as `C:foo` instead of a proper absolute path like `C:\foo`.

## Notes

I have not added a regression test in this PR yet. I can add one in a follow-up if maintainers prefer a specific test location for this path-conversion logic.

Co-authored-by: George Weale <gweale@google.com>
COPYBARA_INTEGRATE_REVIEW=#5523 from cyrus-mz:fix/windows-file-artifact-uri e93847b
PiperOrigin-RevId: 943367471
…play synchronization

Extract `ReplayManager` to unify session event scanning, replay interception, and sequence barrier management across static and dynamic workflow nodes.

Co-authored-by: Shangjie Chen <deanchen@google.com>
PiperOrigin-RevId: 943376672
Merge #6314

PiperOrigin-RevId: 943391685
The userinfo_endpoint field is never read anywhere in ADK, so this
hardcoded URL had no runtime effect. The OAuth flow only uses the
authorization and token endpoints. Removing it.

Co-authored-by: George Weale <gweale@google.com>
PiperOrigin-RevId: 943396380
Merge #4271

**Please ensure you have read the [contribution guide](https://github.com/google/adk-python/blob/main/CONTRIBUTING.md) before creating a pull request.**

### Link to Issue or Description of Change

- Closes: #4270

**Problem:**
 When using MCP tools with McpToolset, configuration information for the object is not exposed as object properties or attributes meaning that 'private' attributes need to be accessed, e.g. toolset._connection_params rather than toolset.connection_params

**Solution:**
Exposed them as properties

### Testing Plan

**Unit Tests:**

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

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

 I have added new test cases also checked locally

### 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 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.
- [x] Any dependent changes have been merged and published in downstream modules.

### Additional context

Co-authored-by: Haran Rajkumar <haranrk@google.com>
COPYBARA_INTEGRATE_REVIEW=#4271 from DineshThumma9:mcp-missing-attr 3d48401
PiperOrigin-RevId: 943396972
Add ManagedAgent(BaseAgent), which drives the Managed Agents interactions.create
API directly. This first cut supports server-side tools only (ADK built-in tools
and raw types.Tool configs); client-executed tools (FunctionTool/callables) and
MCP are rejected with NotImplementedError. Multi-turn chaining reuses
previous_interaction_id and recovers the sandbox environment across turns.

Co-authored-by: Haran Rajkumar <haranrk@google.com>
PiperOrigin-RevId: 943406685
Fixes #5947.

Co-authored-by: George Weale <gweale@google.com>
COPYBARA_INTEGRATE_REVIEW=#6009 from he-yufeng:fix/live-stream-turn-complete f72e0b5
PiperOrigin-RevId: 943418613
Introduce `append` method and `create_sub_branch` classmethod on `_BranchPath`
to standardize dynamic branch path creation across workflow node runners, agent tools,
and parallel agent execution.

Co-authored-by: Shangjie Chen <deanchen@google.com>
PiperOrigin-RevId: 943430872
Merge #5991

# Add Transient Model Input Context to RunConfig

### Link to Issue or Description of Change

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

- Closes: #5990

**Problem:**

Host applications sometimes need to provide request-scoped context to an agent for a single invocation without persisting that context into `session.events`.

Before this change, callers had to either append synthetic session events or merge application context into the user message. Both approaches blur the boundary between durable conversation history and transient model input.

**Solution:**

This change adds `RunConfig.model_input_context`, a list of `google.genai.types.Content` values that are injected into the LLM request for the current invocation only.

The context is deep-copied before insertion, added before the invocation user content, and never appended to `session.events`. The insertion path is separate from instruction-related content so the transient context keeps a stable position across tool-call loops and multi-agent `include_contents="none"` flows.

### Testing Plan

**Unit Tests:**

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

Passed locally:

```text
.venv/bin/python -m pytest tests/unittests/agents/test_llm_agent_include_contents.py tests/unittests/agents/test_run_config.py
14 passed
```

Additional checks:

```text
.venv/bin/pyink --check --diff --config pyproject.toml src/google/adk/flows/llm_flows/contents.py tests/unittests/agents/test_llm_agent_include_contents.py tests/unittests/agents/test_run_config.py
.venv/bin/isort --check-only src/google/adk/flows/llm_flows/contents.py tests/unittests/agents/test_llm_agent_include_contents.py tests/unittests/agents/test_run_config.py src/google/adk/agents/run_config.py
git diff --check
```

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

Not run. This change is covered by focused unit tests around LLM request construction and session persistence.

### 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 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.
- [ ] Any dependent changes have been merged and published in downstream modules.

### Additional context

The unit coverage verifies that transient context:

- is sent to the model without being persisted to the session;
- stays before the invocation user message after a tool call;
- works for a sub-agent using `include_contents="none"` in a sequential flow;
- is accepted by `RunConfig` as `types.Content`.

Co-authored-by: George Weale <gweale@google.com>
COPYBARA_INTEGRATE_REVIEW=#5991 from nicolasmota:spike/model-input-context c835972
PiperOrigin-RevId: 943484488
…cs views

Add usage_thinking_tokens and usage_tool_use_tokens to the LLM_RESPONSE
analytics view, sourced from the usage_metadata proto the plugin already logs
to attributes.usage_metadata (thoughts_token_count and
tool_use_prompt_token_count).

Per the genai GenerateContentResponseUsageMetadata contract, total_token_count =
prompt_token_count + candidates_token_count + tool_use_prompt_token_count +
thoughts_token_count, so thinking and tool-use tokens are separate addends
rather than subsets of prompt/candidates. Surfacing them lets analytics account
for them without double counting. Both fields are optional and resolve to NULL
for models/responses that do not report them, so the change stays
model-agnostic. No plugin logging change is needed since the full usage_metadata
is already persisted to attributes.

Co-authored-by: Haiyuan Cao <haiyuan@google.com>
PiperOrigin-RevId: 943493796
Introduce NodeTool, allowing individual Nodes and entire Workflows to be wrapped and executed as standard ADK Tools.

This PR implements the core, single-turn execution capability:
- Support auto-wrapping of BaseNode (Workflows) directly in Agent.tools.
- Wrapping synchronous and asynchronous function nodes as NodeTools.
- Providing a complete sample workflow demonstrating how to run a workflow as a tool.

Resumption and multi-turn nested HITL support are skipped in this PR and will be fully enabled in the later PR.

Co-authored-by: Shangjie Chen <deanchen@google.com>
PiperOrigin-RevId: 943499058
To prevent OOM issues if HTTP request/response bodies are too long

Co-authored-by: Kathy Wu <wukathy@google.com>
PiperOrigin-RevId: 943502772
Add scripts/check_new_py_files.py, which enforces ADK's private-by-default
policy: a newly-added Python file under src/google/adk/ must have a '_'-prefixed
basename (expose public API via __init__.py / __all__ instead). Newly-added
files are detected by comparing the checked-out tree against a baseline source
tree, so the check needs no git history.

Co-authored-by: Haran Rajkumar <haranrk@google.com>
PiperOrigin-RevId: 943513793
@pull pull Bot locked and limited conversation to collaborators Jul 6, 2026
@pull pull Bot added the ⤵️ pull label Jul 6, 2026
@pull pull Bot merged commit 63561ce into CrazyForks:main Jul 6, 2026
1 of 16 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.