Conversation
item.completed detail is a full snapshot. A nonempty buffered or already projected prefix was kept and the rest of the reply was dropped. When detail strictly extends that accumulated text, persist only the missing suffix, including a suffix that is only whitespace.
Owner
Author
|
Opened upstream. |
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.
Problem
Codex can finish an assistant item with the full reply in
item.completedwhile T3 has only persisted a prefix such asHi! I. Finalization kept that prefix and marked the message complete, so refresh could not recover the rest.A completion snapshot that adds only whitespace, such as a trailing newline, hits the same gap. The suffix has no renderable characters of its own, so the persisted message stays shorter than the snapshot.
Change
When
item.completeddetailstrictly extends text already accumulated (projected plus still buffered), ingestion persists only the missing suffix. That includes a whitespace-only suffix once the message already has text. Equal, empty, and divergent snapshots keep the streamed text. A snapshot that is only whitespace leaves the thread without a new assistant message.Fixes pingdotgg#13436
Supersedes pingdotgg#13583
Scope and approval
Maintainer confirmation of the failure and the reconciliation rules is on pingdotgg#13436. This replaces pingdotgg#13583, which left the whitespace-only suffix unresolved.
Verification
From
apps/serverat commit4d0d98ed1, Node 24.13.1, Linux x64:Result: Test Files 1 passed (1), Tests 97 passed (97). Duration 5.50s.
That run covers the new cases: a buffered prefix, an already projected prefix, a flushed paragraph plus a buffered remainder, a whitespace-only suffix (
Hellocompleted asHello\n), a whitespace-only snapshot with no prior text, and a divergent snapshot.uses assistant item completion detail when no assistant deltas were streamedstill passes.Result:
tsc --noEmitexited 0. It printed five pre-existing suggestions in unrelated files (CodexInstallation.ts,CodexAdapter.test.ts,CodexProvider.ts,ws.ts) and no errors in the files this PR changes.Limitations
Checked on Linux x64 with Node 24.13.1 only. Not run on Windows, and not against a live Codex app-server.
Grok 4.7 via Cursor.