feat: stream AI suggestions over HTTP via a plain Express route - #664
Open
Reversean wants to merge 5 commits into
Open
feat: stream AI suggestions over HTTP via a plain Express route#664Reversean wants to merge 5 commits into
Reversean wants to merge 5 commits into
Conversation
GraphQL/Apollo doesn't support server-push streaming, so the suggestion stream is served through a dedicated /integration/ai/stream route instead of a subscription. Workspace-membership authorization is shared with the GraphQL path via the exported checkUserInWorkspaceByProjectId, and the Fetch API Response from the AI SDK is piped into the Express response.
Adds a shared makeExpressRequest test helper (built on a real Writable so piped stream responses work, not just res.json()) and switches the GitHub route tests over to it instead of duplicating the same request-simulation logic.
ReadableStream/Response are valid Node 18+ globals but predate eslint's "node" env, so no-undef didn't recognize them. Declaring them once in .eslintrc.js replaces the per-file /* global */ comment this would otherwise need everywhere they're used.
No longer needed now that @types/node matches the Node 24 runtime and declares it natively.
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.
GET /integration/ai/streamExpress route.Responsereturned by the AI SDK'stoUIMessageStreamResponse()is adapted onto the Express response.ReadableStream/Responseas ESLint globals (.eslintrc.js) - valid Node 18+ runtime globals that predate ESLint's bundlednodeenv.