Skip to content

feat(tools): add max_snapshot_bytes limit to transactional ShellExecutor#2476

Merged
bug-ops merged 1 commit intomainfrom
feat/issue-2474/snapshot-size-limit
Mar 30, 2026
Merged

feat(tools): add max_snapshot_bytes limit to transactional ShellExecutor#2476
bug-ops merged 1 commit intomainfrom
feat/issue-2474/snapshot-size-limit

Conversation

@bug-ops
Copy link
Copy Markdown
Owner

@bug-ops bug-ops commented Mar 30, 2026

Summary

  • Add max_snapshot_bytes: u64 to ShellConfig (default 0 = unlimited)
  • TransactionSnapshot::capture() accumulates byte count per file and aborts with ToolError::SnapshotFailed when the limit is exceeded
  • Three new unit tests covering limit exceeded, zero (unlimited), and within-budget cases

Test plan

  • cargo nextest run -p zeph-tools --lib — 922 tests pass
  • cargo +nightly fmt --check — clean
  • cargo clippy -p zeph-tools --all-features -- -D warnings — clean
  • Full workspace nextest run — 7517 passed

Closes #2474

Add `max_snapshot_bytes: u64` to `ShellConfig` (default 0 = unlimited).
`TransactionSnapshot::capture()` now tracks cumulative bytes and aborts
with `ToolError::SnapshotFailed` if the configured limit is exceeded,
preventing disk exhaustion from unbounded snapshot copies.

Closes #2474
@github-actions github-actions bot added documentation Improvements or additions to documentation rust Rust code changes enhancement New feature or request size/M Medium PR (51-200 lines) labels Mar 30, 2026
@bug-ops bug-ops enabled auto-merge (squash) March 30, 2026 22:03
@bug-ops bug-ops merged commit fc09164 into main Mar 30, 2026
27 checks passed
@bug-ops bug-ops deleted the feat/issue-2474/snapshot-size-limit branch March 30, 2026 22:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation enhancement New feature or request rust Rust code changes size/M Medium PR (51-200 lines)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(tools): snapshot size limit for transactional ShellExecutor

1 participant