Skip to content

fix(workflow): Preserve explicit single-turn contents#6047

Open
spectaclehong wants to merge 1 commit into
google:mainfrom
spectaclehong:fix/single-turn-include-contents
Open

fix(workflow): Preserve explicit single-turn contents#6047
spectaclehong wants to merge 1 commit into
google:mainfrom
spectaclehong:fix/single-turn-include-contents

Conversation

@spectaclehong

@spectaclehong spectaclehong commented Jun 10, 2026

Copy link
Copy Markdown

Please ensure you have read the contribution guide before creating a pull request.

Link to Issue or Description of Change

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

Problem:

single_turn LlmAgent workflow nodes currently force include_contents to none at runtime, even when the user explicitly configures include_contents="default". That silently changes the agent configuration and prevents one-shot workflow nodes from intentionally receiving relevant session or workflow history.

Solution:

Only apply the workflow single_turn default of include_contents="none" when include_contents was not explicitly set by the user. This preserves the existing implicit default behavior while respecting explicit include_contents="default" and include_contents="none" values.

Regression coverage was added for implicit and explicit include_contents cases.

Testing Plan

Unit Tests:

  • I have added or updated unit tests for my change.
  • All unit tests pass locally.

Targeted workflow tests pass locally:

uv run pytest tests/unittests/workflow/test_llm_agent_as_node.py -q

Result:

28 passed, 8 skipped, 4 xfailed

Python 3.10 tox unit suite passes locally:

uv tool run --from tox --with tox-uv tox -e py310

Result:

7044 passed, 21 skipped, 31 xfailed, 9 xpassed

Pre-commit hooks pass for changed files:

uv run pre-commit run --files src/google/adk/workflow/_llm_agent_wrapper.py tests/unittests/workflow/test_llm_agent_as_node.py

Manual End-to-End (E2E) Tests:

Validated manually with a local workflow application that uses a single_turn workflow LlmAgent configured with include_contents="default". The run confirmed that the explicit contents mode is preserved instead of being overwritten to none.

No ADK Web or UI behavior is changed.

Checklist

  • I have read the CONTRIBUTING.md document.
  • 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.
  • 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

No documentation update was made because this change does not add a new user-facing API or guide behavior; it preserves explicit configuration that was already supported by LlmAgent.include_contents.

No dependent changes are required.

single_turn workflow nodes previously forced include_contents to none even when users explicitly set include_contents='default'. Use Pydantic field tracking to keep explicit values while preserving the implicit default.

Fixes google#6046
@google-cla

google-cla Bot commented Jun 10, 2026

Copy link
Copy Markdown

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@adk-bot

adk-bot commented Jun 10, 2026

Copy link
Copy Markdown
Collaborator

Response from ADK Triaging Agent

Hello @spectaclehong, thank you for your contribution!

We noticed that a couple of things are missing according to our contribution guidelines:

  1. Contributor License Agreement (CLA): It looks like the CLA check has failed. Please visit https://cla.developers.google.com/ to sign the Google CLA so that we can review your pull request.
  2. Testing Summary: Although you've included the test commands in the "Tests" section, could you please provide a brief summary of the passed pytest results? This helps our reviewers ensure everything is working as expected.

This information will help reviewers to review your PR more efficiently. Thanks!

@adk-bot adk-bot added the core [Component] This issue is related to the core interface and implementation label Jun 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core [Component] This issue is related to the core interface and implementation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

single_turn workflow nodes overwrite explicit include_contents

2 participants