Files
anomalyco_opencode/packages/opencode
Aiden Cline e06a099a88 fix(opencode): let NaN/Infinity flow in Rune, normalize to null at the boundary
Rune previously threw the instant any non-finite number materialized, which
killed the program before the model's own guard could run — so idiomatic code
like parseInt(x) || 0, Number(x) then Number.isNaN(x), averages, and counters
crashed mid-expression. Real JS (and a real-engine sandbox) let these values
flow and rely on JSON serialization to turn them into null at the edge.

- copyIn no longer rejects non-finite numbers, so NaN/Infinity exist as ordinary
  in-sandbox intermediates and defensive guards can run.
- copyOut normalizes non-finite numbers to null as a value leaves the sandbox;
  final return and tool-call arguments both funnel through it, so one check pins
  both boundaries (matching JSON.stringify, which produces null anyway).
- NaN/Infinity are now bindable identifiers (e.g. reduce(max, -Infinity)).

Extends rune-parity.test.ts (guards run, non-finite -> null out incl. nested, a
direct copyOut unit test) and updates rune.md.
2026-07-01 12:26:55 -05:00
..
2026-03-27 15:00:26 +01:00
2025-05-30 20:48:36 -04:00
2026-02-18 13:54:23 -05:00

js

To install dependencies:

bun install

To run:

bun run index.ts

This project was created using bun init in bun v1.2.12. Bun is a fast all-in-one JavaScript runtime.