Skip to content

fix(workflow): compact execution storage and trim history#295

Merged
duguwanglong merged 2 commits into
devfrom
fix/workflow-execution-storage-compaction
May 20, 2026
Merged

fix(workflow): compact execution storage and trim history#295
duguwanglong merged 2 commits into
devfrom
fix/workflow-execution-storage-compaction

Conversation

@xiami762
Copy link
Copy Markdown
Contributor

Summary

  • Compact large alert lists in workflow execution records (outputs, step inputs/outputs, and ToolResult.metadata) before writing to SQLite, JSONL audit logs, or returning to agents — replaces lists with _<key>_count when above the size threshold.
  • Cap per-workflow execution history at 30 records and delete matching {exec_id}.jsonl audit files when pruning oldest entries.
  • Add compact_step_for_storage helper shared by run_workflow, HTTP workflow routes, and Recorder.

xiami762 and others added 2 commits May 20, 2026 16:05
Persist compacted workflow outputs in storage and JSONL audit logs to
avoid bloating SQLite rows. Cap per-workflow execution history at 30
and delete matching JSONL files when pruning old records.

Co-authored-by: Cursor <cursoragent@cursor.com>
Extend history compaction to step inputs via compact_step_for_storage,
and return compacted outputs/history in run_workflow ToolResult metadata
so agent context stays bounded alongside SQLite/JSONL storage.

Co-authored-by: Cursor <cursoragent@cursor.com>
@xiami762 xiami762 requested a review from duguwanglong May 20, 2026 08:18
@duguwanglong duguwanglong merged commit 7783bf1 into dev May 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants