Skip to content

fix: fix pool metadata protocol version refresh, rivetkit native ws#4585

Open
MasterPtato wants to merge 1 commit intorivetkit-nativefrom
04-07-fix_fix_pool_metadata_protocol_version_refresh_rivetkit_native_ws
Open

fix: fix pool metadata protocol version refresh, rivetkit native ws#4585
MasterPtato wants to merge 1 commit intorivetkit-nativefrom
04-07-fix_fix_pool_metadata_protocol_version_refresh_rivetkit_native_ws

Conversation

@MasterPtato
Copy link
Copy Markdown
Contributor

Description

Please include a summary of the changes and the related issue. Please also include relevant motivation and context.

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?

Please describe the tests that you ran to verify your changes.

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
Copy Markdown

railway-app bot commented Apr 8, 2026

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

Service Status Web Updated (UTC)
website 😴 Sleeping (View Logs) Web Apr 8, 2026 at 4:57 pm
frontend-inspector ❌ Build Failed (View Logs) Web Apr 8, 2026 at 12:10 am
frontend-cloud ❌ Build Failed (View Logs) Web Apr 8, 2026 at 12:10 am
mcp-hub ✅ Success (View Logs) Web Apr 8, 2026 at 12:10 am
kitchen-sink ❌ Build Failed (View Logs) Web Apr 8, 2026 at 12:09 am
ladle ❌ Build Failed (View Logs) Web Apr 8, 2026 at 12:09 am

@claude
Copy link
Copy Markdown

claude bot commented Apr 8, 2026

PR Review: Pool Metadata Protocol Version Refresh & RivetKit Native WebSocket Fixes

Summary

This PR addresses protocol version refresh for serverless runner configurations and fixes WebSocket handling issues in the RivetKit native module. Changes include refactoring actor name management, improving cache handling, and fixing architecture issues in the native envoy client.


Positive Aspects

  • Cleaner workflow architecture: The new refresh_metadata operation consolidates protocol version updates and actor name persistence, reducing scattered logic.
  • Protocol version downgrade handling: Error reporting through the error tracker workflow for envoy protocol version downgrades is well-structured.
  • Logging compliance: All Rust files correctly use tracing macros without any println!/eprintln! violations.

Issues

Critical

1. Empty PR description
The PR body is empty (just the template). This makes it very hard to understand motivation, scope, and intended behavior changes. Please fill in the description.

2. WASM/Native VFS parity (CLAUDE.md requirement)
Per CLAUDE.md: "The native Rust VFS and the WASM TypeScript VFS must match 1:1." The changes to sqlite-native/src/vfs.rs (83 additions/73 deletions) and kv.rs (135 additions/130 deletions) are significant. Were the corresponding sqlite-wasm/src/vfs.ts and kv.ts updated in sync? If not, this breaks data compatibility between backends.

3. Breaking config schema change
engine/artifacts/config-schema.json changes the cache object's required field from ["driver"] to ["enabled"]. This is a breaking change for any existing configuration that has only a driver field. No migration path or backward-compat shim is documented.


Moderate

4. Silent truncation in WebSocket key generation

fn make_ws_key(gateway_id: &[u8], request_id: &[u8]) -> [u8; 8] {
    let mut key = [0u8; 8];
    if gateway_id.len() >= 4 {
        key[..4].copy_from_slice(&gateway_id[..4]);
    }
    if request_id.len() >= 4 {
        key[4..].copy_from_slice(&request_id[..4]);
    }
    key
}

Inputs shorter than 4 bytes are silently zero-padded, and inputs longer than 4 bytes are silently truncated. Neither case logs a warning. This could hide protocol mismatches. At minimum, add a comment explaining the intended format and when truncation/padding is expected.

5. Undefined returns in wrapper.js (fail-by-default violation)

getProtocolMetadata: () => undefined,
getActor: () => undefined,

Per CLAUDE.md: "Avoid silent no-ops for required runtime behavior... If a capability is required, validate it and throw an explicit error with actionable context instead of returning early." If these are required capabilities, they should throw. If genuinely optional, add a comment explaining why.

6. Engine runner parity (CLAUDE.md requirement)
The envoy-client changes affect the Rust runner. Per CLAUDE.md: "Any behavior... added to one runner should be mirrored in the other runner in the same change whenever possible." Have the TypeScript runner equivalents been verified or updated? If not, document the gap explicitly.


Minor

7. Missing test coverage
No tests were added for:

  • Protocol version downgrade detection path
  • WebSocket key generation edge cases (empty input, input shorter than 4 bytes)
  • Cache-disabled early-return path in req_config.rs

8. Cargo.lock dependency removal
gasoline was removed from rivet-envoy-protocol dependencies. Worth confirming no downstream code relied on it being transitively available.


CLAUDE.md Compliance

Convention Status Notes
Hard tabs for Rust Maintained
Structured logging (tracing) No violations found
Error handling (anyhow/Result) Correct pattern
No glob imports Checked modified files
Native/WASM VFS sync ⚠️ Needs verification
Engine runner parity ⚠️ Needs verification
Fail-by-default behavior ⚠️ undefined returns in wrapper.js

Recommended Actions

  • Add a meaningful PR description
  • Verify sqlite-wasm/src/vfs.ts and kv.ts are updated in sync with native changes
  • Document config migration path or ensure backward compatibility for cache schema change
  • Add comment explaining make_ws_key key format and truncation behavior
  • Replace undefined returns in wrapper.js with explicit throws or explanatory comments
  • Verify or document TypeScript envoy-client parity
  • Add tests for protocol downgrade, cache-disabled path, and WS key edge cases

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