- Enable resumability and add Human-in-the-Loop (HITL) step to `node_as_tool` sample workflow.
- Update `node_as_tool` README to document the HITL multi-turn flow.
- Fix `agent_test_runner.py` to preserve the `branch` field when replaying user events in tests.
- Implement lazy rehydration of `resume_inputs` from `session.events` in `NodeRunner` for standalone nodes (e.g. nodes run as tools of an Agent). This allows standalone nodes to resume correctly.
Co-authored-by: Shangjie Chen <deanchen@google.com>
PiperOrigin-RevId: 948503030
- Decouple task-mode node execution from default output binding so standard text output does not prematurely finish the node.
- Enhance the runner to automatically resolve and reuse the invocation_id of active suspended task nodes.
- Route incoming plain text resume messages to the active task node by mapping to its isolation scope.
- Enforce strict concurrency serialization by suspending parallel branch execution when a task node is waiting for user input.
- Align schema validation helpers to cleanly handle Content wrapping and raw JSON strings.
Co-authored-by: Shangjie Chen <deanchen@google.com>
PiperOrigin-RevId: 945423735
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
Merge https://github.com/google/adk-python/pull/6155
**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
**1. Link to an existing issue (if applicable):**
N/A
**2. Or, if no issue exists, describe the change:**
**Problem:**
The repository is missing Apache 2.0 license headers across 155 files. This is required by Google OSPO.
**Solution:**
Prepended the standard Apache 2.0 open-source license header to all flagged files. The copyright year was dynamically assigned based on each file's first commit year in git history.
### Testing Plan
_Please describe the tests that you ran to verify your changes. This is required for all PRs that are not small documentation or typo fixes._
**Unit Tests:**
- [ ] I have added or updated unit tests for my change.
- [x] All unit tests pass locally.
_Please include a summary of passed `pytest` results._
N/A - This PR only adds comments (license headers) to the top of files and contains zero functional code changes. No new tests are needed, and existing tests should pass as-is.
**Manual End-to-End (E2E) Tests:**
N/A - No functional code was changed.
### 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.
- [ ] I have commented my code, particularly in hard-to-understand areas.
- [ ] 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.
- [ ] I have manually tested my changes end-to-end.
- [ ] Any dependent changes have been merged and published in downstream modules.
### Additional context
Co-authored-by: Shangjie Chen <deanchen@google.com>
COPYBARA_INTEGRATE_REVIEW=https://github.com/google/adk-python/pull/6155 from milenvk:fix-missing-licenses d2a264b9a812fd997daf975ec37996e6b4b7a042
PiperOrigin-RevId: 936165783
Set role='model' in the Content object generated by create_request_input_event()
to ensure proper role attribution when returning function call events to the client.
Co-authored-by: Shangjie Chen <deanchen@google.com>
PiperOrigin-RevId: 929538818