Repository navigation
Simplify immutable chat updates and image history selection - #911
Gajesh2007 wants to merge 1 commit into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
@codex review |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex Review: Didn't find any major issues. Chef's kiss. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
69fcd34 to
81bcfed
Compare
3c019ac to
bdc5dea
Compare
|
@codex review |
|
Codex Review: Didn't find any major issues. Nice work! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
bdc5dea to
ec70980
Compare
|
@codex review |
|
Codex Review: Didn't find any major issues. 🎉 Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Chat content updates, thinking updates, and message patches each repeat a nested immutable chat/message traversal. Share that traversal while keeping existing object identity, append order, and persistence behavior. Finding the latest image turn now uses findLastIndex, avoiding a full history copy and reversal before every send/retry. Removes 34 production lines.
Targets master with the complete TypeScript validation from merged #902. Persistence keys, image limits, request shape, streaming flags, and nonmatching messages retain their existing behavior.
Validation: pinned Node 22 passes 697 tests, full TypeScript, ESLint (existing warnings), and Next build. Three new public-store characterization tests also pass against the original store: sibling identity, ordered content/thinking batches and metadata patches, unknown IDs, and image/streaming persistence boundaries. Existing image-history tests pass unchanged.
flowchart LR subgraph Before A[Token / thought / patch actions] --> B[Three nested chat and message traversals] B --> C[Immutable state and sanitized persistence] D[Send or retry] --> E[Copy and reverse history] E --> F[Newest image turn in API messages] endflowchart LR subgraph After A[Token / thought / patch actions] --> B[mapMessage with specific update] B --> C[Same immutable state and sanitized persistence] D[Send or retry] --> E[findLastIndex] E --> F[Same newest image turn in API messages] endRebased onto merged #902 in master
06518dc93. The entire Git tree and the master-relative binary patch are identical to the previously reviewed source. Fresh Node 22.23.2 validation passes all 697 tests across 89 files with no skips and the complete TypeScript check; prior lint/build evidence applies to the identical source tree. The rebased commit has a verified SSH signature.