You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Task sub-agent with a date/datetime/Decimal/UUID field in input_schema crashes the turn: validate_node_data dumps in python mode, to_user_content cannot json.dumps it #8240
Describe the Bug:
A task-mode sub-agent whose input_schema has a date, datetime, Decimal or UUID field fails every delegation. validate_node_data (google/adk/utils/_schema_utils.py) validates the call's arguments into the model and then dumps it with model_dump(exclude_none=True), which is Pydantic's python mode, so the dict keeps the datetime.date. run_llm_agent_as_node then hands that dict to to_user_content (google/adk/utils/content_utils.py), whose json.dumps(value, ensure_ascii=False) raises TypeError: Object of type date is not JSON serializable. The sub-agent node fails, and so does the parent's turn.
The model did nothing wrong here: it sent "2026-10-17", which is what a date field accepts.
This is the same python-mode dump as #6747. #6750 fixed it in d1e61e5 on 2026-10-01 and 731ea30 (same title, 23:05 UTC) reverted that evening, so main still has it (line 426 of _schema_utils.py today, and the same _to_serializable in validate_node_data in 2.14.1). #7480 (cause 2) and #7591 cover the sibling validate_schema, which AgentTool uses; neither touches validate_node_data, which is the path a task sub-agent takes.
Steps to Reproduce:
pip install google-adk==2.11.0 (also reproduced on 2.14.1)
Run the script below. It needs no network or API key: the model is a fake.
Expected Behavior:
The sub-agent receives its input, with the date as "2026-10-17", and the turn completes (turn completed).
Observed Behavior:
turn failed: TypeError: Object of type date is not JSON serializable
The traceback ends in to_user_content (content_utils.py, json.dumps), reached from run_llm_agent_as_node.
Environment Details:
ADK Library Version: 2.11.0, and 2.14.1 (same code in validate_node_data)
Python Version: 3.12
Are you using LiteLLM: No (fake model)
Possible fix:
Either dump with mode="json" in validate_node_data._to_serializable, as #6750 did (its commit message flags it as a breaking change for in-memory node outputs, which may be why it was reverted), or leave validate_node_data alone and make to_user_content serialize what it is given the way Pydantic does (for example pydantic_core.to_json, or json.dumps(..., default=...)), since that is the one place the value has to be JSON.
I reproduced this with the fake-model Runner. May I take this issue with a fix limited to JSON encoding in to_user_content? A local candidate handles date, datetime, Decimal and UUID values while retaining Python types in FunctionNode outputs, without changing validate_node_data. The targeted Runner and serialization regressions pass locally; I have not run the required full multi-version tox suite yet.
Activity
widechaos commentedon Nov 18, 2026
I reproduced this with the fake-model Runner. May I take this issue with a fix limited to JSON encoding in
to_user_content? A local candidate handles date, datetime, Decimal and UUID values while retaining Python types in FunctionNode outputs, without changingvalidate_node_data. The targeted Runner and serialization regressions pass locally; I have not run the required full multi-version tox suite yet.