Relationships
#4489 workflow run --json reports a succeeded run as failed, and history get --json crashes, when resource content is nested past about 5,250 levels
Opened by zack · 11/6/2026· Shipped 11/6/2026
Summary
The JSON renderers print a run view with native JSON.stringify(data, null, 2) (src/presentation/renderers/workflow_run_display.ts:34), which overflows the stack on deeply nested resource content. Found while verifying swamp-club#4488; present on main before swamp-club#4469.
- workflow run --json exits 1 with {"error": "Workflow execution failed: Maximum call stack size exceeded"}, but workflow history search records the run (parent and child) as succeeded. Log mode renders the same run normally and exits 0. The CLI reports a failure for a run that succeeded.
- workflow history get --json exits 1, stack at JSON.stringify in renderWorkflowRunDisplay (workflow_run_display.ts:34) via workflow_history_get.ts:48. Log mode exits 0.
- workflow history outputs --json is unaffected (it streams through prettyJsonChunks).
Steps to reproduce
- A behavior whose method writes one resource { i: 0, tree: [[[ ... [0,1,2] ... ]]] } nested N levels deep.
- Workflow wfdeep: one model_method step running it with N = 6000. Workflow wfp-deep: a type: workflow step running wfdeep, then a tail step.
- swamp workflow run wfp-deep --json: exit 1, Workflow execution failed. swamp workflow history search: status succeeded.
- swamp workflow history get wfp-deep --json: exit 1, Maximum call stack size exceeded.
Threshold measured with a binary built from the swamp-club#4488 branch: 5,200 levels pass, 5,300 fail.
Expected
A render failure must not be reported as a run failure; the JSON output should print (for example through writeJsonValue from src/presentation/output/json_stream.ts, which is depth-independent) or fail with an error that says the output could not be rendered, not that the workflow failed.
Shipped
Click a lifecycle step above to view its details.
Sign in to post a ripple.