Repository navigation
Conversation
chatCompletedHandler() dereferenced _existing.content without a null check; server-echoed tool-role messages (sent by expandContentBlocks() without a content field) could be absent from history.messages, throwing TypeError and aborting the follow-up turn before the chat was persisted. Aligns with the optional chaining already used for _existing?.content_blocks on the next line. Co-authored-by: Cursor <cursoragent@cursor.com>
|
🐳 The image has been built and pushed with the following tags: |
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.
Fixes SLOP-144
Summary
chatCompletedHandler()insrc/lib/components/chat/Chat.sveltedereferenced_existing.contentwithout a null check when merging server-echoed messages back intohistory.messages.role: \"tool\"messages (built byexpandContentBlocks()) that carry nocontentfield; if such a message is not present in local history, the merge throwsTypeError: Cannot read properties of undefined (reading 'content'), aborting the follow-up turn beforeupdateChatById()persists the chat (losing the just-completed exchange)._existing, matching the_existing?.content_blocksguard already on the next line.Test plan
py_compilefor backend counterpart; minimal 2-line frontend diff re-read)content_blocks) completes without console errorscontentfieldWork performed by AI / Cursor Agent under direction of Ike.