Description
When a flow produces a large result object (observed at ~1.2MB of JSON), the CLI either truncates the output or crashes with Invalid string length. This affects complex orchestration flows where intermediate results accumulate.
Reproduction
Create a flow that:
- Calls multiple sub-flows that each return 50-200KB of output
- Aggregates results into a single
buildResult step
- Execute with
one --agent flow execute <key>
Expected: Full JSON result on stdout
Actual: Truncated output or Invalid string length error
Workaround
Write the result to a checkpoint file as the last flow step, then have the parent process read the file instead of relying on stdout:
{
"id": "writeCheckpoint",
"type": "file-write",
"fileWrite": {
"path": "/tmp/flow-result.json",
"content": "$.steps.buildResult.output"
}
}
Suggested Fix
- Stream large outputs to a temp file and return a reference, or
- Increase the internal string buffer limit, or
- Add a
--output-file <path> flag for flow execution
Description
When a flow produces a large result object (observed at ~1.2MB of JSON), the CLI either truncates the output or crashes with
Invalid string length. This affects complex orchestration flows where intermediate results accumulate.Reproduction
Create a flow that:
buildResultstepone --agent flow execute <key>Expected: Full JSON result on stdout
Actual: Truncated output or
Invalid string lengtherrorWorkaround
Write the result to a checkpoint file as the last flow step, then have the parent process read the file instead of relying on stdout:
{ "id": "writeCheckpoint", "type": "file-write", "fileWrite": { "path": "/tmp/flow-result.json", "content": "$.steps.buildResult.output" } }Suggested Fix
--output-file <path>flag for flow execution