Implement edit functionality for user messages slg 28#233
Draft
Implement edit functionality for user messages slg 28#233
Conversation
Refactor chat streaming to use @langchain/svelte's useStream hook and wire submit/stop, loading and error state through the new API. Add message edit/save UI and handlers (ChatMessage, ChatMessages, UserMessageActions) so users can edit a human message and re-run a generation using message metadata/checkpoints. Normalize message handling by switching to @langchain/core message types and using getContent helpers across components (AIMessageActions, ChatToolMessage, FeedbackButtons, ScrollableContainer). Minor API change: streamAnswer now accepts an optional checkpointId. package.json: bump @langchain/langgraph-sdk and add @langchain/svelte. Tests updated to reflect enabled edit button behavior. Co-Authored-By: Claude <claude@users.noreply.github.com>
useStream v0.1.3 ignores options.threadId — the internal threadId store is always initialized as undefined. On the first submit(), it saw undefined and called client.threads.create() to make a new empty thread, causing all existing history to vanish. Fix by calling switchThread(thread.thread_id) immediately after useStream initialization, which is the only way to pre-set the internal store. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude <claude@users.noreply.github.com>
1 new issue
|
In ChatMessages.svelte, replace the previous !finalAnswerStarted condition with isLoading to control rendering of <ChatWaiting/>. This makes the waiting state explicit and improves clarity/fix for when the waiting UI should be shown.
aryadhruv
commented
Mar 23, 2026
| onEditSave | ||
| }: Props = $props(); | ||
|
|
||
| function getContent(message: BaseMessage): string { |
aryadhruv
commented
Mar 23, 2026
Comment on lines
+57
to
+59
| <div class="w-full space-y-2"> | ||
| <Textarea bind:value={editText} class="min-h-24 text-sm" /> | ||
| <div class="flex justify-end gap-2"> |
Contributor
Author
There was a problem hiding this comment.
Refactor. long enough that it deserves it's own space
Run report for 66893601Total time: 5m | Comparison time: 6m 28s | Estimated savings: 1m 27s (22.6% faster)
Touched files |
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.
My attempt at Vibe codded PR