Skip to content

feat(actor): add metadata patching and projection#4420

Open
NathanFlurry wants to merge 1 commit intomainfrom
actor-metadata-api
Open

feat(actor): add metadata patching and projection#4420
NathanFlurry wants to merge 1 commit intomainfrom
actor-metadata-api

Conversation

@NathanFlurry
Copy link
Member

Description

This adds per-actor metadata patching and read projection across the engine, runner protocol, and RivetKit surfaces. Actors can now patch metadata internally, the REST API can patch metadata without waking sleeping actors, point lookups return full metadata, and list queries can project selected metadata_key values. The change also adds mk2 protocol v8 support for metadata patch events and wires the RivetKit file-system and remote manager paths through the same feature.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

  • cargo check --manifest-path engine/sdks/rust/runner-protocol/Cargo.toml
  • cargo check --manifest-path engine/packages/pegboard/Cargo.toml
  • cargo check --manifest-path engine/packages/api-peer/Cargo.toml
  • cargo check --manifest-path engine/packages/api-public/Cargo.toml
  • Added RivetKit metadata driver tests, but pnpm -C rivetkit-typescript/packages/rivetkit check-types could not run in this workspace because node_modules are missing.
  • cargo check --manifest-path engine/packages/engine/Cargo.toml --tests is still blocked by existing engine test drift outside this feature, and engine/packages/engine/tests/api_actors_list.rs still needs metadata_key literals added.

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

@railway-app
Copy link

railway-app bot commented Mar 13, 2026

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

Service Status Web Updated (UTC)
frontend-inspector 😴 Sleeping (View Logs) Web Mar 13, 2026 at 9:55 pm
frontend-cloud 😴 Sleeping (View Logs) Web Mar 13, 2026 at 9:54 pm
website ❌ Build Failed (View Logs) Web Mar 13, 2026 at 9:45 pm
mcp-hub ✅ Success (View Logs) Web Mar 13, 2026 at 9:43 pm
ladle ❌ Build Failed (View Logs) Web Mar 13, 2026 at 9:43 pm

@pkg-pr-new
Copy link

pkg-pr-new bot commented Mar 13, 2026

More templates

@rivetkit/cloudflare-workers

pnpm add https://pkg.pr.new/rivet-dev/rivet/@rivetkit/cloudflare-workers@4420

@rivetkit/framework-base

pnpm add https://pkg.pr.new/rivet-dev/rivet/@rivetkit/framework-base@4420

@rivetkit/next-js

pnpm add https://pkg.pr.new/rivet-dev/rivet/@rivetkit/next-js@4420

@rivetkit/react

pnpm add https://pkg.pr.new/rivet-dev/rivet/@rivetkit/react@4420

rivetkit

pnpm add https://pkg.pr.new/rivet-dev/rivet/rivetkit@4420

@rivetkit/sql-loader

pnpm add https://pkg.pr.new/rivet-dev/rivet/@rivetkit/sql-loader@4420

@rivetkit/sqlite-vfs

pnpm add https://pkg.pr.new/rivet-dev/rivet/@rivetkit/sqlite-vfs@4420

@rivetkit/traces

pnpm add https://pkg.pr.new/rivet-dev/rivet/@rivetkit/traces@4420

@rivetkit/workflow-engine

pnpm add https://pkg.pr.new/rivet-dev/rivet/@rivetkit/workflow-engine@4420

@rivetkit/virtual-websocket

pnpm add https://pkg.pr.new/rivet-dev/rivet/@rivetkit/virtual-websocket@4420

@rivetkit/engine-runner

pnpm add https://pkg.pr.new/rivet-dev/rivet/@rivetkit/engine-runner@4420

@rivetkit/engine-runner-protocol

pnpm add https://pkg.pr.new/rivet-dev/rivet/@rivetkit/engine-runner-protocol@4420

commit: 7c4d940

@claude
Copy link

claude bot commented Mar 13, 2026

PR Review: feat(actor): add metadata patching and projection. Overall this is a well-structured feature. The layered validation, projection enum pattern, and async-safe file writes are all solid. Issues to address: (1) Potential Bug - Unbounded Subscription Wait in engine/packages/api-peer/src/actors/patch_metadata.rs: patched_sub.next().await? has no timeout. If the actor workflow receives the PatchMetadata signal but crashes before sending MetadataPatched, the REST call hangs indefinitely. Add a timeout. (2) Schema file v8.bare is labeled 'Runner Protocol v1' at the top - should be v8. (3) Validation limits and key regex are duplicated across three places (actor_metadata.rs, runner mod.ts, metadata-limits.ts) with no sync mechanism. (4) Missing docs: limits.mdx needs the new metadata limits, troubleshooting.mdx needs the new error codes. (5) engine tests/api_actors_list.rs metadata_key literals not yet added per PR description. (6) Minor: getWithKey in file-system manager always reads full metadata even when not needed. (7) Minor: validate_patch is called redundantly inside apply_patch. (8) Nit: indentation in Main::PatchMetadata match arm around line 598 of workflows/actor/mod.rs.

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