Skip to content

improvement(logs): raise execution log size limits to 3MB / 512KB#4778

Merged
TheodoreSpeaks merged 1 commit into
stagingfrom
fix/max-execution-output-size
May 28, 2026
Merged

improvement(logs): raise execution log size limits to 3MB / 512KB#4778
TheodoreSpeaks merged 1 commit into
stagingfrom
fix/max-execution-output-size

Conversation

@TheodoreSpeaks
Copy link
Copy Markdown
Collaborator

Summary

  • Bump MAX_EXECUTION_DATA_BYTES 500KB → 3MB
  • Bump MAX_WORKFLOW_VALUE_BYTES 64KB → 512KB — this is what was summarizing finalOutput on agent outputs just over 64KB
  • Update logger tests to exercise the truncation path against the new ceilings

Type of Change

  • Improvement

Testing

Tested manually. bun run lint and bun run check:api-validation:strict pass. Logger unit tests (13) pass.

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@vercel
Copy link
Copy Markdown

vercel Bot commented May 28, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
docs Skipped Skipped May 28, 2026 10:25pm

Request Review

@cursor
Copy link
Copy Markdown

cursor Bot commented May 28, 2026

PR Summary

Medium Risk
Larger JSON payloads per execution log row increase database storage and read size; behavior is otherwise the same compaction path with higher thresholds.

Overview
Raises the execution logger’s stored-payload ceilings so more workflow output is kept before summarization kicks in.

MAX_EXECUTION_DATA_BYTES goes from 500KB to 3MB for the overall executionData JSON written to workflow execution logs. MAX_WORKFLOW_VALUE_BYTES goes from 64KB to 512KB, which governs how large finalOutput and workflowInput can be during the first compaction pass—agent outputs slightly above the old 64KB limit were being replaced with truncation placeholders.

The oversized-storage unit test now uses a ~1.1MB fixture and asserts the compacted record stays within 3MB, matching the new total cap.

Reviewed by Cursor Bugbot for commit aa7c410. Bugbot is set up for automated code reviews on this repo. Configure here.

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented May 28, 2026

Greptile Summary

Raises two execution-log size constants to stop premature truncation of large but legitimate agent outputs. MAX_EXECUTION_DATA_BYTES moves from 500 KB to 3 MB and MAX_WORKFLOW_VALUE_BYTES (the per-field ceiling applied when the total exceeds the overall limit) moves from 64 KB to 512 KB; the multi-stage compaction fallback logic is unchanged.

  • MAX_WORKFLOW_VALUE_BYTES 64 KB → 512 KB fixes the specific case where agent finalOutput objects just over 64 KB were being summarised even in executions whose total log size was otherwise well under the old 500 KB ceiling.
  • The test payload is scaled from 220 K to 1.1 M characters so it still reliably exceeds the new 3 MB total ceiling and exercises the truncation path; the bound assertion is updated to match.

Confidence Score: 5/5

Safe to merge — the change is two constant edits, the three-tier compaction fallback is untouched, and the test correctly exercises the truncation path against the new ceilings.

Both constants are straightforward limit bumps. The compaction logic, the multi-stage fallback chain, and all surrounding code are unmodified. PostgreSQL JSONB handles values well beyond 3 MB natively, so no schema constraint is violated. The updated test payload (1.1 MB × multiple slots ≈ 6+ MB) reliably triggers truncation under the new threshold and verifies the expected output shape.

No files require special attention.

Important Files Changed

Filename Overview
apps/sim/lib/logs/execution/logger.ts Two constants bumped: MAX_EXECUTION_DATA_BYTES (500KB → 3MB) and MAX_WORKFLOW_VALUE_BYTES (64KB → 512KB); no logic changes.
apps/sim/lib/logs/execution/logger.test.ts Test payload scaled to 1.1 MB and the byte-size ceiling assertion updated to match the new 3 MB limit; coverage of the truncation path is preserved.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[buildCompletedExecutionData] --> B{totalBytes > 3 MB?}
    B -- No --> C[Store as-is]
    B -- Yes --> D[Summarize: remove executionState\ntruncate trace I/O to 8 KB\ntruncate finalOutput to 512 KB]
    D --> E{Still > 3 MB?}
    E -- No --> F[Store summarized]
    E -- Yes --> G[Minimal: strip trace I/O entirely\nkeep metadata only]
    G --> H{Still > 3 MB?}
    H -- No --> I[Store minimal]
    H -- Yes --> J[Store metadata-only fallback]
Loading

Reviews (1): Last reviewed commit: "improvement(logs): raise execution log s..." | Re-trigger Greptile

@TheodoreSpeaks TheodoreSpeaks merged commit f778d01 into staging May 28, 2026
14 checks passed
@waleedlatif1 waleedlatif1 deleted the fix/max-execution-output-size branch May 29, 2026 01:03
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.

1 participant