Skip to content

test(runner): cover node-runtime behaviors #1103

Draft
wolo-lab wants to merge 3 commits into
v2from
wolo/workflow-agent-test-parity
Draft

test(runner): cover node-runtime behaviors #1103
wolo-lab wants to merge 3 commits into
v2from
wolo/workflow-agent-test-parity

Conversation

@wolo-lab

@wolo-lab wolo-lab commented Jun 27, 2026

Copy link
Copy Markdown
Contributor

Summary

Ports the runner-level node behaviors from adk-python's
tests/unittests/runners/test_runner_node.py into adk-go's
runner/run_node_test.go, to confirm behavioral parity around the
run_node path in runners.py. adk-go has no Runner(node=...)
constructor, so each case drives a node graph wrapped in a
workflowagent (or a plain LlmAgent root) through the same node
runtime.
Test-only change — no production code is touched.

What's covered

Behaviors adk-go already implements correctly (now verified at the
runner level):

  • terminal node output + persistence to the session
  • node error propagation to the caller of Run
  • event accumulation across multiple turns in one session
  • yield_user_message defaulting to off
  • WithStateDelta applied to session state before the node / LlmAgent
    runs, and surfaced on the yielded user event
  • plain text not triggering the resume path

Intentional divergence (guarded by characterization tests)

adk-python's Runner._run_node_async rejects malformed resume messages
(test_mixed_fr_and_text_raises, test_resume_raises_on_unmatched_fr,
test_resume_raises_on_multi_invocation_fr). adk-go is deliberately more
permissive: the A2A flow resumes a paused task by sending the human's
reply text alongside the approval function response in a single
message (agent/remoteagent/v2/a2a_e2e_test.go, msg3), and
buildResumeResponses ignores responses that answer no pending
interrupt.
Two characterization tests (TestRunner_Node_AllowsMixedFunctionResponseAndText,
TestRunner_Node_ToleratesUnmatchedFunctionResponse) lock in this
permissive behavior so a future "parity" change can't silently break
A2A. Porting the adk-python guards was tried and reverted because it
failed the A2A e2e tests.

Port the runner-level node behaviors from adk-python's
tests/unittests/runners/test_runner_node.py to run_node_test.go. adk-go
has no Runner(node=...) constructor, so each case drives a node graph
wrapped in a workflowagent (or an LlmAgent root) through the same node
runtime.

Covers behaviors adk-go already implements: terminal output plus
persistence, error propagation, event accumulation across turns,
yield_user_message default-off, state delta applied before the node and
the LlmAgent run and surfaced on the user event, and plain text not
triggering resume.

Also adds two characterization tests guarding an intentional divergence
from adk-python: adk-go accepts a resume message that mixes a function
response with text and tolerates a function response with no matching
call, because the A2A flow resumes a paused task by sending the human's
reply text alongside the approval response in one message
(agent/remoteagent/v2/a2a_e2e_test.go).
@wolo-lab wolo-lab force-pushed the wolo/workflow-agent-test-parity branch from 3eab9c4 to ee46a28 Compare June 27, 2026 22:55
wolo-lab added 2 commits June 29, 2026 07:30
Address review feedback on the comments added in the previous commit:

- YieldUserMessageFalseByDefault: the doc said the user event "is
  persisted but not yielded" but only the not-yielded half was checked;
  add a session-history assertion (sessionHasUserText) so the comment is
  backed by a check.
- StateDeltaAppliedBeforeLlmAgentRuns: the before-agent callback returns
  content and short-circuits the agent, so the model is never consulted;
  reword the comment to stop implying it runs after.
- AllowsMixedFunctionResponseAndText: assert the model is actually
  consulted (fresh run yields "handled") instead of only checking for no
  error, matching the sibling ToleratesUnmatchedFunctionResponse test and
  making newPermissiveAgent's doc honest. Drops the now-unused
  collectRunError helper.
- Replace the bespoke errNode string type with errors.New; nothing type-
  asserts it, and fix its comment wording.
Drop the floating "the tests below" block comment: the "below" anchor
rots the moment a test is appended, and the adk-python provenance it
carried already lives in the PR description rather than belonging in the
code. Keep the one piece of in-code value (why node graphs are wrapped in
a workflowagent, since adk-go has no Runner(node=...) constructor) by
folding it into the newUpperWorkflowAgent doc comment.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant