Skip to content

Fix: --limits none now fully disables engine-level limit enforcement #375

Merged
ejacquier merged 3 commits into
mainfrom
simulation-limits-fix
Apr 16, 2026
Merged

Fix: --limits none now fully disables engine-level limit enforcement #375
ejacquier merged 3 commits into
mainfrom
simulation-limits-fix

Conversation

@ejacquier
Copy link
Copy Markdown
Contributor

Summary

--limits none was intended to disable all limit enforcement during simulation, but only suppressed CLI-side checks (WASM binary size, HTTP request/response
size). The engine itself still applied its built-in defaults from cresettings.Default — for example HTTPAction.CallLimit = 5 — because ResolveLimits("none")
returns nil and the WorkflowSettingsCfgFn callback skipped applyEngineLimits when simLimits == nil, leaving the engine to fall back to its own defaults.

This caused unexpected errors like cannot use 6, limit is 5 even when --limits none was explicitly passed.

Fix

cmd/workflow/simulate/limits.go — adds disableEngineLimits(cfg *cresettings.Workflows), which sets all engine limit fields to effectively unbounded values
(math.MaxInt32 for int/size fields, 24h for duration fields).

This covers all capability categories: execution, WASM, logging, HTTPAction, ConfidentialHTTP, Consensus, ChainWrite, ChainRead, and Secrets.

cmd/workflow/simulate/simulate.go — in the WorkflowSettingsCfgFn callback, adds an else if inputs.LimitsPath == "none" branch that calls disableEngineLimits(cfg), so the engine receives the uncapped values instead of falling back to its built-in defaults.

@ejacquier ejacquier requested a review from a team as a code owner April 15, 2026 12:48
@github-actions
Copy link
Copy Markdown

👋 ejacquier, thanks for creating this pull request!

To help reviewers, please consider creating future PRs as drafts first. This allows you to self-review and make any final changes before notifying the team.

Once you're ready, you can mark it as "Ready for review" to request feedback. Thanks!

// Execution limits
cfg.ExecutionTimeout = maxDuration
cfg.ExecutionResponseLimit = maxSize
cfg.ExecutionConcurrencyLimit = maxInt
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: These limits seem quite excessive? A buggy workflow could OOM a test machine

@ejacquier ejacquier enabled auto-merge April 16, 2026 20:13
@ejacquier ejacquier added this pull request to the merge queue Apr 16, 2026
Merged via the queue into main with commit e365640 Apr 16, 2026
22 checks passed
@ejacquier ejacquier deleted the simulation-limits-fix branch April 16, 2026 20:51
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