Skip to content

OptimizedNodeBridge cache should be opt-in and safe for non-JSON args #42

@bbopen

Description

@bbopen

Summary

OptimizedNodeBridge caches calls via JSON.stringify args; circular/BigInt args throw, and cache heuristics can return stale results for stateful functions.

Failure mode

  • Calls can throw before reaching Python when args are not JSON-serializable.
  • Cached results can be incorrect for non-pure functions with misleading names.

Proposed fix

  • Make caching opt-in/configurable for OptimizedNodeBridge.
  • Guard cache key generation with try/catch; bypass cache on stringify errors.
  • Optionally require an explicit allowlist of cacheable functions.

Acceptance criteria

  • Calls with circular/BigInt args still execute without cache errors.
  • Caching is disabled by default or explicit; tests cover both paths.

Metadata

Metadata

Assignees

Labels

area:runtime-nodeArea: Node runtime bridgebugSomething isn't workingpriority:p2Priority P2 (medium)

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions