Skip to content

feat(streams): add actor subscriptions and durable stream delivery - #5877

Draft
NathanFlurry wants to merge 1 commit into
stack/feat-auth-add-scoped-jwks-signing-wqyqvztnfrom
stack/feat-streams-add-actor-subscriptions-and-durable-stream-delivery-vvvunzlw
Draft

NathanFlurry wants to merge 1 commit into
stack/feat-auth-add-scoped-jwks-signing-wqyqvztnfrom
stack/feat-streams-add-actor-subscriptions-and-durable-stream-delivery-vvvunzlw

Conversation

@NathanFlurry

@NathanFlurry NathanFlurry commented Oct 14, 2026 •

Copy link
Copy Markdown
Member

Summary

Add RivetKit actor stream declarations, subscriptions, and Durable Streams delivery in the TypeScript and Rust runtimes. Guard authorizes the real stream gateway route, and actor wake callbacks verify the Durable Streams JWKS and signed payload. Stacked on Engine signing #5878.

Validation

  • Rust CI, RivetKit type check, quality check, and edge bundle checks pass.
  • A secured local Engine and Durable Streams run delivered a named stream message through Engine to a RivetKit actor, which processed it successfully.
  • Dashboard Type Check reports unrelated frontend type errors in files outside this PR.

@railway-app

railway-app Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

🚅 Deployed to the rivet-pr-5877 environment in rivet-frontend

Service Status Web Updated
kitchen-sink 😴 Sleeping (View Logs) Web Oct 14, 2026 at 9:47 am UTC
website ❌ Build Failed (View Logs) Web Oct 14, 2026 at 9:37 am UTC
ladle ⏭️ Skipped (View Logs) Web Oct 14, 2026 at 9:37 am UTC
mcp-hub ⏭️ Skipped (View Logs) Web Oct 14, 2026 at 9:37 am UTC
frontend-inspector 😴 Sleeping (View Logs) Web Oct 14, 2026 at 9:36 am UTC
5 services not affected by this PR
  • mcp-hub
  • ladle
  • frontend-cloud
  • frontend-cloud-ee
  • sentry-tunnel

@claude

claude Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

Review: feat(streams): actor subscriptions and durable stream delivery (updated for 78cf128)

I re-checked the open items from the previous review against the new head. I did not build the PR or run its tests.

Still open (verified in the current code)

  1. resume has no permission check, though the docs require gateway Update. registry/http.rs (FrameworkHttpRoute::StreamControl) calls stream_resume and stream_status with no token check, and guard only does ActorGateway:Read for these paths. Any caller with read access can resume a paused stream. Enforce Update for /internal/streams/resume, or fix the docs. I would enforce it. StreamControl also skips the max_incoming_message_size check that the redrive branch has.
  2. /internal and /internal/* are now reserved on every actor. RegistryHttpRoute returns NotFound for them, even for actors that do not use streams. That breaks user onRequest handlers at those paths. Gate it on streams being configured, or document it as a breaking change.
  3. Guard keys storage authorization on the actor name "durableStream". A user actor with that name would take the storage path. Reserve the name, or confirm that path cannot grant more than ActorGateway:Read.
  4. Non-protocol paths on storage actors only check Update. storage_requests returns Update for anything other than /request/protocol. Please confirm nothing reachable there can read or delete stream data. The unit test only covers /action/internal.
  5. data_operation(.., fork=false) is hardcoded. The fork branch inside it is dead. Fork is handled separately through stream-forked-from, so please make sure no other fork header skips the parent Read check.
  6. api-public/.../stream_access.rs validates its input loosely (value["path"] == path plus len() == 2). A typed struct with deny_unknown_fields would be clearer.

Conventions (CLAUDE.md)

  • serde_json::to_vec(&value).expect("JSON status") in StreamControl should use ? like the neighbouring branches.
  • Token extraction (x-rivet-token or Authorization: Bearer) is duplicated. Extract a helper.
  • The native-runtime / not(native-runtime) scaffolding is repeated across the stream branches. An early return would be shorter.
  • stream.not_paused.json exists only under rivetkit-rust/engine/artifacts/errors/. It is missing from engine/artifacts/errors/ and from docs/api/error-registry.json. Please confirm this is intended, since CI checks these artifacts.
  • Cargo.lock carries unrelated bumps (url, idna, percent-encoding, form_urlencoded).
  • The PR description is empty. Repo convention is a short bullet list.
  • docs/actors/sidebar.json has space-indented entries in a tab-indented file.
  • The new stream.checkpoint.v2.bare and stream.redrive.v1.bare schemas use versioned vbare with v1 untouched, which follows the guidance.

Performance

The guard auth loop runs up to 3 sequential rivet_auth::check calls per fork or close request. That is bounded and fine.

Tests

Operation aliasing and key/path binding are covered well. Still missing:

  • a negative test that status and resume are rejected without the documented permission (this would have caught item 1);
  • a test for the /internal/* 404 behavior and its effect on user routes;
  • a test that a read-only grant cannot provision a storage actor via get_or_create;
  • sql_efficiency coverage of any new stream queries.

Items 1 and 2 should be resolved before merging.

@NathanFlurry
NathanFlurry force-pushed the stack/feat-streams-add-actor-subscriptions-and-durable-stream-delivery-vvvunzlw branch from bac943a to b745659 Compare October 14, 2026 03:59
@NathanFlurry
NathanFlurry force-pushed the stack/feat-streams-add-actor-subscriptions-and-durable-stream-delivery-vvvunzlw branch from b745659 to 60dbc7e Compare October 14, 2026 04:01
@NathanFlurry
NathanFlurry force-pushed the stack/feat-streams-add-actor-subscriptions-and-durable-stream-delivery-vvvunzlw branch from 60dbc7e to f0525b0 Compare October 14, 2026 09:05
@NathanFlurry
NathanFlurry changed the base branch from main to stack/feat-auth-add-scoped-jwks-signing-wqyqvztn October 14, 2026 09:05
@NathanFlurry

Copy link
Copy Markdown
Member Author

Stack for rivet-dev/rivet

Get stack: forklift get 5877
Push local edits: forklift submit
Merge when ready: forklift merge 5877

change kkuysnkl

@NathanFlurry
NathanFlurry force-pushed the stack/feat-streams-add-actor-subscriptions-and-durable-stream-delivery-vvvunzlw branch from f0525b0 to 4b68e1f Compare October 14, 2026 09:26
@NathanFlurry
NathanFlurry force-pushed the stack/feat-auth-add-scoped-jwks-signing-wqyqvztn branch from b6ce67f to 3a9711b Compare October 14, 2026 09:26
@NathanFlurry
NathanFlurry force-pushed the stack/feat-streams-add-actor-subscriptions-and-durable-stream-delivery-vvvunzlw branch from 4b68e1f to ec53373 Compare October 14, 2026 09:30
@NathanFlurry
NathanFlurry force-pushed the stack/feat-auth-add-scoped-jwks-signing-wqyqvztn branch from 3a9711b to 6bd9b37 Compare October 14, 2026 09:30
@NathanFlurry
NathanFlurry force-pushed the stack/feat-streams-add-actor-subscriptions-and-durable-stream-delivery-vvvunzlw branch from ec53373 to 1b1efd9 Compare October 14, 2026 09:32
@NathanFlurry
NathanFlurry force-pushed the stack/feat-auth-add-scoped-jwks-signing-wqyqvztn branch from 6bd9b37 to 6dcbb71 Compare October 14, 2026 09:32
@NathanFlurry
NathanFlurry force-pushed the stack/feat-streams-add-actor-subscriptions-and-durable-stream-delivery-vvvunzlw branch from 1b1efd9 to 78cf128 Compare October 14, 2026 09:37
@NathanFlurry
NathanFlurry force-pushed the stack/feat-auth-add-scoped-jwks-signing-wqyqvztn branch from 6dcbb71 to 33386a9 Compare October 14, 2026 09:37

This branch had an error being deployed

1 failed deployment
rivet-frontend / rivet-pr-5877 — 78cf1288 Deployed Oct 14, 2026 by railway-app[bot]
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