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
DatabaseSessionService stores non-ASCII text as \uXXXX escapes in TEXT JSON columns #7610
Describe the Bug: DatabaseSessionService stores non-ASCII text (e.g. Japanese) as \uXXXX escape sequences in JSON columns on databases that store JSON as TEXT (SQLite, MySQL, etc.). The cause is DynamicJSON.process_bind_param in src/google/adk/sessions/schemas/shared.py, which calls json.dumps(value) with the default ensure_ascii=True.
Reproduced this on 2.12.0 and current main with SQLite @marosiy and the root cause in DynamicJSON looks right.
One thought on #7612: a blanket ensure_ascii=False might be risky on SQL Server where Text maps to VARCHAR(max) and non-UTF8 collations can turn raw characters into "?". A possible workaround is to keep escaping only there, e.g. return json.dumps(value, ensure_ascii=dialect.name == "mssql").
Could you try this on your side and check that existing rows still load fine and the new rows are stored unescaped? Might also be worth a quick look at SqliteSessionService since it uses plain json.dumps too.
Once you’ve tested it and it works feel free to update the PR and we can get it in front of the reviewers.
Activity
fix(sessions): store non-ASCII text unescaped in DatabaseSessionService
surajksharma07 commentedon Oct 19, 2026
Reproduced this on 2.12.0 and current main with SQLite @marosiy and the root cause in DynamicJSON looks right.
One thought on #7612: a blanket ensure_ascii=False might be risky on SQL Server where Text maps to VARCHAR(max) and non-UTF8 collations can turn raw characters into "?". A possible workaround is to keep escaping only there, e.g. return json.dumps(value, ensure_ascii=dialect.name == "mssql").
Could you try this on your side and check that existing rows still load fine and the new rows are stored unescaped? Might also be worth a quick look at SqliteSessionService since it uses plain json.dumps too.
Once you’ve tested it and it works feel free to update the PR and we can get it in front of the reviewers.