feat(web): pickle-safe dynamic relay bridge classes - #3569
Conversation
Greptile SummaryThis change adds deterministic dynamic relay bridge classes that retain their stream definitions and class identity across serialization and module reloads. A reload followed by deployment of the surviving class into a newly created worker completed successfully, including generated-stream and missing-stream RPC lookups. Confidence Score: 5/5No blocking failure remains. The exercised reload and clean-worker deployment flow preserved class identity and completed the expected stream and RPC operations.
What T-Rex did
Reviews (3): Last reviewed commit: "feat(web): pickle-safe dynamic relay bri..." | Re-trigger Greptile |
| assert pickle.loads(data) is C, "pre-reload pickle lost identity" | ||
| assert pickle.loads(pickle.dumps(C)) is C, "re-pickle after reload failed" | ||
| again = mod.make_relay_bridge_class([mod.DynamicPortSpec("reload_feed", Vector3, "rx")]) | ||
| assert again is C, "factory lost identity after reload" |
There was a problem hiding this comment.
Reload-to-worker path remains untested
The reload test re-pickles the surviving generated class only in the interpreter where it remains published, while the fresh-worker test does not reload first. This leaves the coordinator's combined reload-plus-clean-worker deployment sequence untested, allowing a regression at that serialization boundary to pass the suite.
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
Codecov Report❌ Patch coverage is
@@ Coverage Diff @@
## paul/feat/w4-robot-carrier #3569 +/- ##
==============================================================
+ Coverage 77.51% 77.57% +0.06%
==============================================================
Files 1266 1268 +2
Lines 121739 122050 +311
Branches 10733 10758 +25
==============================================================
+ Hits 94362 94677 +315
+ Misses 24347 24341 -6
- Partials 3030 3032 +2
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 4 files with indirect coverage changes 🚀 New features to boost your workflow:
|
75a2c63 to
028d143
Compare
- make_relay_bridge_class(specs) builds RelayBridgeModule subclasses at runtime. A spec is (stream, message type, direction), nothing else. - DimOS ships module classes through pickle (forkserver deploy, Actor.__reduce__). A runtime-built class cannot pickle by reference. - So the classes get a dedicated metaclass registered with copyreg: pickle serializes the port specs and rebuilds the class through the factory. - The factory is memoized process-wide so repeated unpickles return the identical class object (blueprints compare classes with `is`). - The reducer ships plain field tuples, not spec instances, so a class from a reloaded module still repickles cleanly. - Spec validation rejects reserved or invalid stream ids and names that collide with existing RelayBridgeModule attributes. - Pure addition (dynamic.py + tests). The channel authoring ticket on top of this compiles cockpit(channels=...) into such a class.
028d143 to
ee5790b
Compare
No description provided.