The CF Dataplane currently integrates with native Rust CPEX through contextforge-gateway-rs-cpex, but plugin factories are registered statically in-process. We should extend the dataplane integration to support dynamic Rust plugin loading once contextforge-org/cpex#53 is merged/released.
Work needed:
- Enable CF Dataplane to load Rust CPEX plugins from shared libraries at runtime.
- Support dynamic plugin configuration through the existing runtime config path.
- Preserve existing plugin reload behavior when configuration changes.
- Keep the first implementation focused on the current MCP tool hooks.
- Add regression coverage for successful dynamic plugin execution and failure cases such as bad paths, bad entries, or ABI mismatch.
- Document the operational constraints for dynamic plugins, including same-version ABI requirements and in-process execution.
Current code points:
crates/contextforge-gateway-rs-cpex/src/handle.rs owns CpexRuntimeRegistry and PluginFactoryRegistry.
crates/contextforge-gateway-rs-cpex/src/runtime.rs builds GatewayPluginRuntime from CpexConfig and validates the supported CPEX subset.
crates/contextforge-gateway-rs-cpex/src/config.rs loads runtime CPEX config from Redis key ContextForgeGatewayRuntimePluginConfig.
crates/contextforge-gateway-rs-cpex/src/factory.rs only covers statically registered CMF plugin factories today.
This extends #4525 from native Rust CPEX integration to runtime-loadable Rust CPEX plugins.
The CF Dataplane currently integrates with native Rust CPEX through
contextforge-gateway-rs-cpex, but plugin factories are registered statically in-process. We should extend the dataplane integration to support dynamic Rust plugin loading once contextforge-org/cpex#53 is merged/released.Work needed:
Current code points:
crates/contextforge-gateway-rs-cpex/src/handle.rsownsCpexRuntimeRegistryandPluginFactoryRegistry.crates/contextforge-gateway-rs-cpex/src/runtime.rsbuildsGatewayPluginRuntimefromCpexConfigand validates the supported CPEX subset.crates/contextforge-gateway-rs-cpex/src/config.rsloads runtime CPEX config from Redis keyContextForgeGatewayRuntimePluginConfig.crates/contextforge-gateway-rs-cpex/src/factory.rsonly covers statically registered CMF plugin factories today.This extends #4525 from native Rust CPEX integration to runtime-loadable Rust CPEX plugins.