Relationships
#3713 CEL expression results that hold a timestamp, duration or uint become an empty object
Opened by zack · 10/21/2026· Shipped 10/21/2026
Description
CelEvaluator.evaluate and evaluateAsync pass every result through coerceBigInts (src/infrastructure/cel/cel_evaluator.ts). coerceBigInts recurses into any non-null object with Object.entries and rebuilds it as a plain null-prototype object. A cel-js value that is a class instance with no own enumerable fields loses its value:
- timestamp(...) (a JS Date) becomes {}
- duration(...) (cel-js Duration) becomes {}
- 1u (cel-js UnsignedInt) becomes {}
- optional values nested in a map or list become {}
- bytes (Uint8Array) become an index-keyed object
Found while triaging swamp-club#3708 (model.method inputs holding an int fail to serialize).
Steps to reproduce
In a unit test: new CelEvaluator().evaluate with the expression timestamp('2026-01-01T00:00:00Z'), then JSON.stringify the result. It prints {}. The same happens to a timestamp inside a map literal, so a step input written as a CEL expression that yields a timestamp reaches the method as {}.
Expected: the timestamp survives (for example as its ISO string, which is what JSON.stringify gives for the uncoerced Date).
Environment
- swamp main at d693eeaf6
- cel-js 7.6.1
Shipped
Click a lifecycle step above to view its details.
Sign in to post a ripple.