feat(runtime): stream Suspense replacements through Flight - #145
Conversation
Decode Flight incrementally into bounded shell/progress/replace/error/complete events with invocation-local boundary IDs, while keeping dispatch() final-only.
🦋 Changeset detectedLatest commit: 339155b The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 339155b005
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
… 3.5 stage 2) (#156) * refactor(runtime): Effect-native dispatcher and stream pipeline (wave 3.5 stage 2) Rewrite the #145 Flight decode and bound-event pipeline on Effect Streams and fibers while keeping dispatch() and stream() byte-compatible. Refs #152. * fix(build): emit runtime types before agent-bundle declaration emit agent-bundle's test helpers import @agent-bundle/runtime; CI was typechecking that package before runtime dist existed, which is why main's post-#154 Verify jobs fail in ~30s. * docs(runtime): record the verified locked-stream teardown mechanism in comments The maxEvents hang was not a blocking-interrupt deadlock: the acquireRelease finalizer called cancel() on the Flight readable while the Flight client held its reader, the locked-stream rejection became an Effect.promise defect during scope close, and the event stream's exit never surfaced. Document that at the scopedAbortSignal fix site and correct the boundary cancel() comment.
Summary
dispatcher.stream()forshell | progress | replace | error | completeevents with invocation-local boundary IDs, bounded reconciler (depth, nodes, bytes, event rate, elapsed time), real backpressure, and AbortSignal cancellationdispatcher.dispatch()as the default final-only public API so feat(runtime): dispatch final Agent Documents through Flight #144 consumers (generated entries andrenderRoutehelpers) stay compatibleTest plan
pnpm --filter @agent-bundle/runtime test(88 passed, 1 durable-only skipped)pnpm --filter @agent-bundle/runtime typecheckpnpm exec rslint packages/rsc-runtime/src packages/rsc-runtime/testsexamples/rsc-agent-runtimersc-hook.integration.test.ts+host-artifacts.test.ts(12 passed)pnpm eval:spot(1 passed)Delivers stage 3 of #96 under #107 revision 2.