Skip to content

feat(cli): relax execution limits for CLI mode#1076

Merged
chaliy merged 1 commit intomainfrom
feat/cli-relaxed-limits
Apr 6, 2026
Merged

feat(cli): relax execution limits for CLI mode#1076
chaliy merged 1 commit intomainfrom
feat/cli-relaxed-limits

Conversation

@chaliy
Copy link
Copy Markdown
Contributor

@chaliy chaliy commented Apr 5, 2026

Summary

  • CLI/script modes now use ExecutionLimits::cli() — counting-based limits (max commands, loop iterations) are effectively unlimited and no timeout is applied
  • MCP mode retains the existing sandboxed defaults (ExecutionLimits::new())
  • Stdout/stderr capture caps raised to 10 MB for CLI mode
  • Memory-guarding limits (function depth, AST depth, parser fuel) are kept at safe values in all modes
  • New CLI flags --max-loop-iterations, --max-total-loop-iterations, and --timeout allow overriding the defaults when needed
  • Session limits set to unlimited for non-MCP modes

Test plan

  • cargo fmt --check — clean
  • cargo clippy -p bashkit -p bashkit-cli --all-features -- -D warnings — no warnings
  • cargo test -p bashkit-cli --all-features — 30/30 pass
  • CI green

CLI/script modes now use ExecutionLimits::cli() which removes
counting-based limits (commands, loop iterations) and timeout — the user
explicitly chose to run the script and has Ctrl-C. Stdout/stderr caps
raised to 10 MB. Memory-guarding limits (function depth, AST depth,
parser fuel) are kept.

MCP mode retains the sandboxed defaults since requests come from LLM
agents.

The --max-commands, --max-loop-iterations, --max-total-loop-iterations,
and --timeout flags remain as overrides for both modes.
@chaliy chaliy merged commit 4a787fa into main Apr 6, 2026
27 checks passed
@chaliy chaliy deleted the feat/cli-relaxed-limits branch April 6, 2026 00:06
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