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:
@@ -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]";
|
||||
|
||||
@@ -418,7 +418,7 @@ export default function workflowsPluginFactory(registry) {
|
||||
return {
|
||||
runId: result.runId,
|
||||
status: result.status,
|
||||
result: result.result,
|
||||
result: store.toDisplayValue(result.result),
|
||||
};
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user