fix: save sessions with camelCase aliases

Make sure that the adk run --save_session writes session JSON using the Pydantic camelCase aliases (by_alias=True), matching ADK Web and keeping session files consistent

Close #3558

Co-authored-by: George Weale <gweale@google.com>
PiperOrigin-RevId: 834847209
This commit is contained in:
George Weale
2025-11-20 11:41:11 -08:00
committed by Copybara-Service
parent caf23ac49f
commit bf8b85da52
+3 -1
View File
@@ -218,6 +218,8 @@ async def run_cli(
session_id=session.id,
)
with open(session_path, 'w', encoding='utf-8') as f:
f.write(session.model_dump_json(indent=2, exclude_none=True))
f.write(
session.model_dump_json(indent=2, exclude_none=True, by_alias=True)
)
print('Session saved to', session_path)