Skip to content

Commit 636b676

Browse files
authored
Merge branch 'main' into add-ci-test-counts
2 parents 3e34fa0 + d9a1079 commit 636b676

7 files changed

Lines changed: 1789 additions & 24 deletions

File tree

tests/mlmodel_googleadk/_test_sub_agent.py

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15+
import copy
16+
17+
from conftest import GOOGLE_ADK_VERSION_TUPLE
1518
from google.adk.agents import LlmAgent
1619

1720
MODEL = "gemini-3.5-flash"
@@ -91,12 +94,17 @@ def build_sub_agent():
9194
sub_agent_recorded_event = [parent_recorded_event, child_recorded_event, transfer_to_agent_recorded_event]
9295

9396

94-
# For error tests, the parent finishes its first turn normally with
95-
# a tool call and does not see an error. The tool call also completes
96-
# normally by initiating the transfer. The child raises an exception
97-
# during its turn, so it is the only event that sees the error.
98-
99-
parent_recorded_event_error = parent_recorded_event
97+
# For error tests, the tool call completes normally by initiating the transfer,
98+
# and the child raises an exception during its turn.
99+
#
100+
# The error status of the parent event depends on the ADK version. The parent agent
101+
# has the error bubble up through run_async on google-adk<2, but on google-adk>=2
102+
# the parent agent's run_async completes normally and the error is contained to the
103+
# child agent's flow.
104+
parent_recorded_event_error = copy.deepcopy(parent_recorded_event)
105+
if GOOGLE_ADK_VERSION_TUPLE < (2, 0, 0):
106+
# Mark only the parent's LlmAgent event as error, as the LlmTool is successful.
107+
parent_recorded_event_error[1]["error"] = True
100108

101109
child_recorded_event_error = (
102110
{"type": "LlmAgent"},

tests/mlmodel_googleadk/_test_workflow_agents.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,13 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15+
import pytest
16+
from conftest import GOOGLE_ADK_VERSION_TUPLE
17+
18+
if GOOGLE_ADK_VERSION_TUPLE < (2, 0, 0):
19+
pytest.skip("google-adk>=2.0.0 required for Workflow", allow_module_level=True)
20+
21+
1522
from google.adk.agents import LlmAgent
1623
from google.adk.workflow import START, Workflow
1724

0 commit comments

Comments
 (0)