-
Notifications
You must be signed in to change notification settings - Fork 237
[world] Add stream pagination and metadata endpoints #1470
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
Merged
Merged
Changes from all commits
Commits
Show all changes
32 commits
Select commit
Hold shift + click to select a range
5d243a3
c
VaguelySerious 2241748
feat: support negative startIndex for streaming
VaguelySerious 40ba940
Merge branch 'main' into peter/negative-start-index
VaguelySerious 749e64b
Merge branch 'main' into peter/negative-start
VaguelySerious 45d474d
undo override
VaguelySerious 4a22114
Consolidate outputStream e2e tests into data-driven loop
VaguelySerious 34ef29e
fix
VaguelySerious a17b11b
Merge branch 'main' into peter/negative-start
VaguelySerious 8b994fc
test
VaguelySerious 23ce02d
Consolidate outputStream e2e tests into data-driven loop
VaguelySerious 2784338
getchunks
VaguelySerious 89939b3
Address PR feedback: docs clarifications and explicit type guards
VaguelySerious 717fe2a
Merge branch 'peter/negative-start' into peter/stream-metadata-and-pages
VaguelySerious d7042d5
changes
VaguelySerious 1a54db8
c
VaguelySerious 7a2ee25
Update docs/content/docs/ai/resumable-streams.mdx
VaguelySerious e3c2169
Merge branch 'peter/negative-start' into peter/stream-metadata-and-pages
VaguelySerious 63a3010
Merge branch 'main' into peter/stream-metadata-and-pages
VaguelySerious d64d41c
Fix edge case
VaguelySerious ae9f7e1
rename
VaguelySerious 3bd0463
clarify comment
VaguelySerious 374b554
fix postgres build
VaguelySerious 4647450
tests
VaguelySerious a9c92a8
Add jsdoc to createStreamer (bust turbo cache)
VaguelySerious 996df1a
Fix e2e test: use renamed getStreamChunks method
VaguelySerious 4480092
Merge branch 'main' into peter/stream-metadata-and-pages
VaguelySerious 24dbf1e
Merge branch 'main' into peter/stream-metadata-and-pages
VaguelySerious 324dd79
Merge main
VaguelySerious 91bcda3
Merge branch 'main' into peter/stream-metadata-and-pages
VaguelySerious 89e418a
Merge branch 'main' into peter/stream-metadata-and-pages
VaguelySerious e3b0c34
Fix stream info edge cases and optimize world implementations
VaguelySerious a82fbe7
Docs, changeset, and observability gaps
VaguelySerious 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,10 @@ | ||
| --- | ||
| "@workflow/world": patch | ||
| "@workflow/world-local": patch | ||
| "@workflow/world-vercel": patch | ||
| "@workflow/world-postgres": patch | ||
| "@workflow/core": patch | ||
| "@workflow/ai": patch | ||
| --- | ||
|
|
||
| Add `getStreamChunks()` and `getStreamInfo()` to the Streamer interface, and `getTailIndex()` to the readable stream returned by `run.getReadable()`. `WorkflowChatTransport` now reads the `x-workflow-stream-tail-index` response header to resolve negative `initialStartIndex` values into absolute positions, fixing reconnection retries after a disconnect. |
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,3 @@ | ||
| { | ||
| "pages": [ | ||
| "...", | ||
| "fatal-error", | ||
| "retryable-error" | ||
| ] | ||
| "pages": ["...", "fatal-error", "retryable-error"] | ||
| } |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -93,4 +93,4 @@ | |
| "@ai-sdk/openai": "^3.0.0", | ||
| "@ai-sdk/xai": "^3.0.0" | ||
| } | ||
| } | ||
| } | ||
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
Oops, something went wrong.
Oops, something went wrong.
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.
Testing gap: malformed header values. The implementation has a
!Number.isNaN(tailIndex)guard (transport line 362) but no test covers it. Consider adding a case where the header is"not-a-number"—parseIntreturnsNaN, the guard should skip resolution, and the code should fall through without settingchunkIndex.Also missing: a test for
initialStartIndex: -1000on a 5-chunk stream (should clamp to 0 viaMath.max), and a test where a positivestartIndexis passed viareconnectToStreamoptions to overrideinitialStartIndex.