Skip to content

Flow output truncated when result exceeds internal string size limit #87

@ameet

Description

@ameet

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:

  1. Calls multiple sub-flows that each return 50-200KB of output
  2. Aggregates results into a single buildResult step
  3. 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

  1. Stream large outputs to a temp file and return a reference, or
  2. Increase the internal string buffer limit, or
  3. Add a --output-file <path> flag for flow execution

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions