fix(server): summarize Buffer values in stored and API JSON

Stop dumping every byte as a number in event I/O, workflow test results, and script dry-runs.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-08-19 15:13:12 +07:00
co-authored by Cursor
parent 2845971670
commit f41e9dc23a
5 changed files with 120 additions and 3 deletions
+4 -1
View File
@@ -1,4 +1,5 @@
import pino from "pino";
import { isBinary, summarizeBinary } from "../../json-preview.js";
import { redactString } from "../../secret-value.js";
const LEVEL_TO_NUM = {
@@ -64,7 +65,9 @@ export function safeSerialize(value) {
try {
return JSON.parse(
redactString(
JSON.stringify(value, (_key, v) => {
JSON.stringify(value, function (key, v) {
const raw = this[key];
if (isBinary(raw)) return summarizeBinary(raw);
if (typeof v === "bigint") return v.toString();
if (typeof v === "object" && v !== null) {
if (seen.has(v)) return "[Circular]";