Repository navigation
perf(server): streamed writes stop re-parsing their payload on the main thread - #118
Merged
fireboltdude1357 merged 2 commits intoOct 27, 2026
Merged
Conversation
Projection writes for message.updated and turn-item.updated parsed the payload they had just encoded, full streamed text included, only to read its timestamps. They now encode the timestamps directly with the schema the payload uses. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…se their payload
fireboltdude1357
left a comment
Owner
Author
There was a problem hiding this comment.
Manual review round 1: crev (claude-opus-5-5 + gpt-6.1-sol) (tier 7/10, deep review)
No verified findings.
Reviewed 2 files (+105 -5), 0b0417a5..67c3161e against origin/patch/streamed-write-timestamps.
Tier 7/10 from claude-opus-5-5: Changes how persisted created_at/updated_at index columns are written for every streamed message and turn item; a format mismatch would silently corrupt ordering and pagination data.
Complexity low: Small local swap of three call sites to encode timestamps directly instead of re-parsing payload JSON; the only subtlety is matching the codec to the payload schema.
fireboltdude1357
merged commit Oct 27, 2026
c33a79c
into
patch/streamed-write-timestamps
1 check passed
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.
While agents stream, every message and turn-item write re-parsed its whole JSON payload on T3's main thread just to read back two timestamps. That's main-thread time taken from every other request. This carries upstream pingdotgg#25162, which encodes those timestamps directly instead.
It's merged onto upstream 0b0417a without conflicts, and its diff is identical to upstream's (
git patch-id). Upstream's CI never ran on it, and its author is unvouched, so it was reviewed line by line:ProjectionStore.ts(+5/−5, a newencodePayloadTimestampand three call sites) and one test. There are no network, process or file calls, no dependency or lockfile changes, no dynamic code and no auth changes.payload_jsonis the same encoder output as before. Thecreated_atandupdated_atcolumns are now written withSchema.DateTimeUtcFromString, the same codec the payload schemas use for those fields, and none of the 24 turn-item members overrides it.Evidence. The PR's own test asserts that the indexed timestamps equal the ones in the payload. It passes with and without the change, because this is a pure performance change. A timing harness checked the mechanism instead: 300 streamed write pairs with about 215 KB of text each, 3 runs per side.
JSON.parseThe re-parse is gone. Wall time is within noise at this size, so treat it as a CPU and GC saving.
Review tier: 6/10; how two indexed timestamp columns are written
Two-way door: removing the patch line drops it from the next fork build
Blast radius:
created_atandupdated_aton stored messages and turn itemsChanges made by Claude Opus 5.5 in Claude Code, running in T3 Code.
🤖 Generated with Claude Code