feat(rivetkit): native actor plugin host (cdylib via dlopen)#5312
feat(rivetkit): native actor plugin host (cdylib via dlopen)#5312NathanFlurry wants to merge 1 commit into
Conversation
Code Review: feat(rivetkit): native actor plugin host (cdylib via dlopen)This PR introduces a generic Blockers1. Planning docs committed to the repo root
2. TOCTOU race in Two concurrent calls for the same path will both miss the cache check (the lock is dropped after the if let Some(existing) = cache().lock().get(&key).cloned() { return Ok(existing); }
// lock drops; both callers miss and both call load_uncached() -> plugin_init called twice
let loaded = unsafe { load_uncached(path) }?;
cache().lock().insert(key, arc.clone());Fix: use 3.
4. extern "C" fn host_ctx_clone(ptr: *const c_void) -> *const c_void {
let _ = std::panic::catch_unwind(|| unsafe {
Arc::increment_strong_count(ptr as *const HostCtxState);
});
ptr // returned regardless of whether the increment succeeded
}If Important Issues5. All of 6.
7. In 8. In Minor9. Changing from pnpm's default isolated linker to hoisted affects the entire monorepo's package resolution and can mask missing explicit dependencies. If this is needed for a specific package, scope it to that package's local 10. ABI version starts at 13
11. In Summary
The ABI design, Generated with Claude Code |
|
🚅 Environment rivet-pr-5312-9585139d-d004-44f6-b072-b38065040390 in rivet-frontend has no services deployed. |
…tegration tests Rebased onto main (2.3.2). Adds the native actor-plugin host (createNativePluginFactory, ABI host loader) so external cdylib plugins (e.g. agent-os) load via dlopen; removes the in-tree bundled agent-os; keeps main's engine auto-spawn + runner-config.
c0c7f71 to
c44621f
Compare
Rebased onto main (2.3.2). Adds the native actor-plugin host so external cdylib plugins (e.g. agent-os) load via
dlopen/the RivetKit native-plugin ABI (createNativePluginFactory, host loader), and removes the in-tree bundled agent-os. Inherits main's engine auto-spawn + auto runner-config.Verified locally: rivetkit JS + napi build clean; vanilla zero-config counter passes (auto engine spawn + auto runner-config) on the rebased build.
🤖 Generated with Claude Code