File: packages/gui/src/state/workspace.ts:62
Severity: High
Description:
Long-running workflow with streaming output: [existing.output, event.output, event.stream, event.text] concatenates repeatedly; each event appends to growing string, causing O(n²) memory allocation.
Code:
const output = [existing.output, event.output, event.stream, event.text].filter(Boolean).join('');
Failure Scenario:
Workflow runs for 10 minutes streaming 100KB/sec → 60MB of output → every event creates new 60MB+ string → O(n²) memory growth → browser OOM crash or severe performance degradation.
Suggested Fix:
- Use rope data structure or append-only buffer
- Limit output to last N characters (e.g., tail 100KB)
- Implement virtual scrolling for output display
File: packages/gui/src/state/workspace.ts:62
Severity: High
Description:
Long-running workflow with streaming output: [existing.output, event.output, event.stream, event.text] concatenates repeatedly; each event appends to growing string, causing O(n²) memory allocation.
Code:
Failure Scenario:
Workflow runs for 10 minutes streaming 100KB/sec → 60MB of output → every event creates new 60MB+ string → O(n²) memory growth → browser OOM crash or severe performance degradation.
Suggested Fix: