-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
fix(sdk): reset skipToTurnComplete when a new chat turn starts #4744
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
wuweiweiwu
wants to merge
4
commits into
triggerdotdev:main
Choose a base branch
from
wuweiweiwu:fix/chat-skip-to-turn-complete-reset
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+77
−0
Open
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
adbf87b
fix(sdk): reset skipToTurnComplete when a new chat turn starts
devin-ai-integration[bot] 04d2fc0
Merge branch 'main' into fix/chat-skip-to-turn-complete-reset
matt-aitken d721dbd
Merge branch 'main' into fix/chat-skip-to-turn-complete-reset
wuweiweiwu 9902a08
test: cover new turn after a stop without turn-complete
wuweiweiwu File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| "@trigger.dev/sdk": patch | ||
| --- | ||
|
|
||
| Fix chat transport discarding the next turn after stopping generation. `skipToTurnComplete` is now reset when a new message or action is sent, so a message sent after `stopGeneration` streams normally instead of leaving the chat stuck in a streaming state. |
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
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔍 Stopped-turn leftover chunks no longer skipped
Clearing
skipToTurnComplete(chat.ts:875, chat.ts:1290) means the new subscription streams every record from its resume cursor. ThesinceInSeqguard atchat.ts:1994filters only staleTURN_COMPLETErecords, not leftover text-deltas from the stopped turn. If any remain on.outbelow the new send, they can now surface in the new turn's UI. Depends on server stop semantics; the author's test streamed cleanly.Was this helpful? React with 👍 or 👎 to provide feedback.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Real trade-off, and it is intentional. Some notes for a maintainer who knows the server stop semantics:
TURN_COMPLETE. If the stopped turn never writes one, the flag survives every later turn, so the chat is stuck inisStreaminguntil a reload. That is the bug this PR fixes.session-in-event-idrides onturn-completerecords only (writeTurnCompleteChunkinai.ts), so thesinceInSeqguard cannot see data records. A per-record turn marker on.outwould be needed for exact filtering.If stop does write a
TURN_COMPLETEfor the stopped turn, the flag clears on the next subscription anyway and this reset changes nothing. Happy to follow a different approach if you want the residue filtered server-side.Written by Devin