Repository navigation
fix(desktop): render chat execute_sql datetime columns in local time with zone label (#12321) - #12349
Merged
Conversation
…with zone label Failure-Class: new
This was referenced Aug 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Bug
Desktop chat's
execute_sqltool renders SQLiteDATETIMEcolumns (timestamp,createdAt,startedAt,completedAt) as raw naive-UTC text, and the chat model presents that text as if it were already local time — a 3:59:51 PM EDT event shows as 7:59:51 PM. Fixes #12321.Root cause
SQLQueryResultProjection.renderedValuecopies GRDBDatecell values verbatim. GRDB storesDatecolumns as naive UTC text (yyyy-MM-dd HH:mm:ss.SSS, no zone marker), so nothing in the pipeline ever applies the UTC→local offset before the string reaches the model.Fix
SQLQueryResultProjection.swift: datetime-shaped columns (timestamp, or a name ending[a-z]At, e.g.createdAt/startedAt/completedAt) are parsed as naive UTC and re-rendered inTimeZone.currentwith an explicit zone abbreviation, mechanically, rather than relying on the model to apply the offset itself. Non-datetime string columns are untouched.What I tested
Rebased onto current
main(2f2be5a) and ran the fullChatToolExecutorSQLTestssuite viaxcrun swift test --package-path Desktop --filter ChatToolExecutorSQLTests: 14/14 passing, including the new regression testtestExecuteSQLRendersDatetimeColumnsInLocalTimeWithZoneLabel(exact UTC instant from the reported repro, asserted against the local-zone rendering).Product invariants affected
Failure-Class: new
🤖 automated by hourly watchdog — tested and merged