Files
anomalyco_opencode/packages/opencode/test
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-06-29 18:52:55 +00:00
2026-06-29 17:58:20 +00:00
2026-06-29 17:58:20 +00:00
2026-06-23 04:57:55 +00:00
2026-06-29 20:53:48 +00:00
2026-06-29 20:36:56 +00:00
2026-06-29 16:58:51 +00:00
2026-06-29 20:53:48 +00:00
2026-06-29 03:49:43 +00:00
2026-06-29 17:58:20 +00:00
2026-06-29 17:58:20 +00:00