LlmAgent inherits from BaseNode but should not go through _run_node_async because it needs the full agent tracing and plugin lifecycle that is currently missing in that path.
Change-Id: Ia2f36f61f80cb5f089e67cccf569c9b2d2e1f306
Extract output forwarding logic to a helper method and standardize response unwrapping. Update tests to explicitly set rerun_on_resume=True where re-running is expected.
Change-Id: I9af28ceee5d74a1086d13bbc13ccaae87936817f
Fixes the infinite loop observed in the 'request_input_rerun' sample where resume_inputs were inappropriately carried over during backedge execution.
- Implement _create_node_state_for_new_run to create a fresh NodeState for new execution runs, preserving only the run_counter.
- Clear resume_inputs in _handle_completion after successful completion to avoid carryover to subsequent runs.
- Remove XFAIL from test_dynamic_node_parallel_execution as it now passes due to better state isolation.
Change-Id: I866cda8a6b9252a3d5f93f277b428b88fcbcef36
By checking if the node has output before checking if it has resolved interrupts, we avoid re-running a node that has already completed.
Change-Id: I77b150b722830682cef9325e6a44499e84ccde09
Move the 2.0 Mesh-based LlmAgent from agents/llm_agent.py to
agents/llm_agent_workflow/ and the 2.0 workflow nodes from
agents/llm/new/ to agents/llm_agent_node/. This clears the
agents/llm_agent.py slot for the upcoming 1.X LlmAgent restoration.
Change-Id: I491652a61e6668433d8e51e93cdeaac0212ab5b6
This allows JoinNode to reuse the same run_id and state key across multiple triggers in the same logical run, fixing the fan-out/fan-in pattern.
Change-Id: Ic9fd476f6176fe87cc6b3e2cf21013c5683a310c
The state_schema commit added _state_schema to InvocationContext,
but tests using Mock(spec=InvocationContext) didn't expose it.
Change-Id: Ifafeda8fb41447f5c802dfbc8e9b8cf8825ffc1a
Transition `output_for` from a simple path list to a list of `(node_path, run_id)`
tuples. This enforces deterministic rehydration by ensuring events are only
attributed back to the specific execution run that requested them.
- Update `NodeInfo` schema to store `(path, run_id)` tuples in `output_for`.
- Refactor `DynamicNodeScheduler` to use both path and `run_id` for rehydration matching.
- Propagate current `run_id` upward when delegating output to ancestors.
- Add defensive error logging for events missing a `run_id` during rehydration scan.
- Add regression tests for run-id isolation and nested multi-turn delegation.
Change-Id: I853f5bb9a6b2343a38d3ac03fc7355032ba7c064
- Extract ToolActions merging logic into a helper function
- Simplify tool output serialization and eliminate NodeInfo dependency
- Propagate ToolActions directly through the execution flow
- Update relevant unit tests
Change-Id: Ib480333c8ab2c45ac143149bd1054fa032abc39a
- Encapsulate tool outputs into ToolNodeOutput
- Return ToolActions directly from RunToolsNode instead of bubbling up to ctx.actions
- Update termination logic in SingleLlmAgentNode
Change-Id: I3719592502623678fe051bc082b3891838ab3c13
- Groups state, output, and task into DynamicNodeRun\n- Separates iterations by run_id inside dict[str, dict[str, DynamicNodeRun]]\n- Adds fallback for single active run backward compatibility\n- Updates unit tests to verify nested state accesses
Change-Id: Ib2c18b56df18cbc2b544c31ba19c86097361d30e
Why the test fails:
- The Runner is now designed to propagate errors from nodes (from _cleanup_root_task). Swallowing errors silently is not the intended behavior.
- The run_node implementation in src/google/adk/agents/context.py
explicitly checks for rerun_on_resume flag
Change-Id: I8c554bb5764a818e9d2dfafab0ecd35712921fcf
Ignore runtime caches in _LlmAgentWrapper equality comparison. This allows Comparing wrappers for registry duplicate checks without failing on separate instances of runtime variables.
This is to fix the broken tests/unittests/workflow/test_dynamic_node_registry.py::test_llm_agent_wrapper_deep_check_success test, without this change:
```
node1 = _LlmAgentWrapper(agent=agent)
node2 = _LlmAgentWrapper(agent=agent)
assert node1 == node2 ---> fails
```
Change-Id: I25d9ca4152a8ecba73b396f307d5398eb9b17f39
Allow callers to pass run_id to ctx.run_node() so child node events
use a caller-specified run ID instead of the default '1'. Also rename
the deprecated positional `run_id` to `_node_name` in the
ScheduleDynamicNode protocol to reflect what it actually carries.
Change-Id: I6ef1709fa9f1c0f33794f804c5da7bfa561f6ee3
Remove defensive null checks for EventActions and NodeInfo properties
as these fields are now populated by default factories and are guaranteed
to be non-null when accessed on Event objects.
Change-Id: I6ae7a38a258589be8945dcd82f005f2f9ba4d9ea
DynamicNodeScheduler: auto-complete rerun_on_resume=False nodes with
resume_inputs dict instead of re-executing.
NodeRunner: pass node.rerun_on_resume to child Context for validation.
Runner: re-raise root node exceptions so callers see failures.
Change-Id: I21aa28d7f2fa3a1738d519e39477e341ae2accda
Update the before_model_callback tests in test_single_llm_agent to
return an `LlmResponse` wrapping `types.Content` instead of a raw
`types.Content`. This matches the callback signature.
Change-Id: Ie7ca7c8e663dd764aa1a22238efaf27a2c8c7e17
Add integration test for nested ctx.run_node() (outer → middle →
inner) verifying interrupt propagation and resume across layers.
Rename child_tracker references to default_scheduler in test names.
Change-Id: Ia360e0f8d8c1b7eade432529c755f3cf32f3e968
LlmCallNode sets message_as_output=True on pure text responses.
_maybe_save_output_to_state sets it for single_turn agents in the
old path. NodeRunner auto-detects this flag and sets
_output_delegated, removing manual delegation in
SingleAgentReactNode, LlmAgentWrapper, and suppressing duplicate
output events in the old path.
Change-Id: I1d6728e128e38eb47ff4a6137ab803e355a51e83