Skip to content

Preserve stream actor context and integrate reviewed CI fixes - #71

Merged
MiguelsPizza merged 10 commits into
mainfrom
alex/stream-callback-gates
Sep 17, 2026
Merged

MiguelsPizza merged 10 commits into
mainfrom
alex/stream-callback-gates

Conversation

@MiguelsPizza

@MiguelsPizza MiguelsPizza commented Sep 17, 2026

Copy link
Copy Markdown
Contributor

Delayed ReadableStream and TransformStream callbacks could enter streamed model work without the creating actor's input lock, causing valid SQL access to fail. Capture their creating actor and async stores, then route pull, transform, flush, and cancel through the existing reentry gate. Preserve synchronous start behavior, callback receivers, frozen sources, and native operation outside an actor.

This PR also incorporates the reviewed commits from #51 and #58, so the combined result is tested against current main before one merge:

  • Wait for each preview navigation before the Vibe example exercises its API, avoiding the execution-context race and cascading persistence failures.
  • Update the pinned pnpm setup action to v6.1.0, which adds pnpm 12 support. The repository's configured pnpm version is unchanged.

Validation: reproduced the original extension SQL failure and confirmed that source callback binding fixes it. The current stream implementation passes 940 runtime unit tests and 74 conformance tests each on Node and workerd. Chromium conformance and both built examples are included in the final CI run. The source/transformer regressions check actor scope, AsyncLocalStorage, receivers, frozen inputs, and isolation from the consumer's unrelated context.

References: WHATWG streams, TC39 Async Context, Rook integration, and the reported failing CI run. Includes a runtime patch changeset. The prior Rook validation covered 153 Chrome E2E cases and delayed-tool/disconnect recovery; it does not establish physical laptop-sleep recovery.

MiguelsPizza and others added 7 commits September 7, 2026 22:42
The built status is written immediately after assigning iframe.srcdoc, while the previous document can still be active. Register for navigation before each build, save, and reload, then wait for the new preview root so API calls use its installed bridge. This also synchronizes the initial automatic build and uses the correct Playwright timeout argument.
Bumps the actions group with 1 update: [pnpm/action-setup](https://github.com/pnpm/action-setup).


Updates `pnpm/action-setup` from 6.0.10 to 6.1.0
- [Release notes](https://github.com/pnpm/action-setup/releases)
- [Commits](pnpm/action-setup@0977fd9...ea17c68)

---
updated-dependencies:
- dependency-name: pnpm/action-setup
  dependency-version: 6.1.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: actions
...

Signed-off-by: dependabot[bot] <support@github.com>
Delayed TransformStream input bypasses transformed awaits and can enter streamed tool execution without an actor input lock. Capture the creating context at construction and use the existing reentry gate for asynchronous callbacks, preserving native receivers and synchronous start timing.
Full extension CI exposed the corresponding ReadableStream gap: source pull callbacks inherited consumer context after transformed chunks re-entered their own gates. Bind native sources and transformers through the same constructor seam. A focused regression reproduces the lost async store, and the real streamed Think example now completes tools, Stop, and recovery.
@MiguelsPizza MiguelsPizza changed the title Preserve actor context in delayed TransformStream callbacks Preserve actor context in native stream callbacks Sep 17, 2026
@MiguelsPizza MiguelsPizza changed the title Preserve actor context in native stream callbacks Preserve stream actor context and integrate reviewed CI fixes Sep 17, 2026
Let the creating input lock expire before pulling so the test proves reentry instead of accidentally sharing the original microtask checkpoint. Also assert that start keeps its synchronous actor scope and receiver.
@MiguelsPizza
MiguelsPizza merged commit 18fc22d into main Sep 17, 2026
1 check passed
@MiguelsPizza
MiguelsPizza deleted the alex/stream-callback-gates branch September 17, 2026 04:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant