fix(workflow): Preserve explicit single-turn contents#6047
fix(workflow): Preserve explicit single-turn contents#6047spectaclehong wants to merge 4 commits into
Conversation
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
|
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. |
|
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:
This information will help reviewers to review your PR more efficiently. Thanks! |
|
Hi @spectaclehong , Thank you for your contribution! We appreciate you taking the time to submit this pull request. Your PR has been received by the team and is currently under review. We will provide feedback as soon as we have an update to share. |
|
Hi @GWeale , can you please review this. |
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):
single_turnworkflow nodes overwrite explicitinclude_contents#6046Problem:
single_turnLlmAgentworkflow nodes currently forceinclude_contentstononeat runtime, even when the user explicitly configuresinclude_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_turndefault ofinclude_contents="none"wheninclude_contentswas not explicitly set by the user. This preserves the existing implicit default behavior while respecting explicitinclude_contents="default"andinclude_contents="none"values.Regression coverage was added for implicit and explicit
include_contentscases.Testing Plan
Unit Tests:
Targeted workflow tests pass locally:
Result:
Python 3.10 tox unit suite passes locally:
Result:
Pre-commit hooks pass for changed files:
Manual End-to-End (E2E) Tests:
Validated manually with a local workflow application that uses a
single_turnworkflowLlmAgentconfigured withinclude_contents="default". The run confirmed that the explicit contents mode is preserved instead of being overwritten tonone.No ADK Web or UI behavior is changed.
Checklist
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.