Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions rlm/environments/subprocess_repl.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,7 @@ def __init__(
allowed_packages: list[str] | None = None,
auto_approve_packages: bool = False,
package_approval_callback: Callable[[str], bool] | None = None,
verbose: bool = False,
**kwargs,
):
"""
Expand All @@ -276,6 +277,7 @@ def __init__(
allowed_packages: Pre-approved packages (no prompt needed).
auto_approve_packages: If True, install packages without prompting.
package_approval_callback: Custom function for package approval.
verbose: If True, print overhead summary on cleanup (default: False).
"""
super().__init__(persistent=persistent, depth=depth, **kwargs)

Expand All @@ -295,6 +297,7 @@ def __init__(
self.sandbox = sandbox
self.auto_approve = auto_approve_packages
self.approval_callback = package_approval_callback or self._default_approval
self.verbose = verbose

# Pre-approved packages (stdlib + user-specified)
self.allowed_packages: set[str] = {
Expand Down Expand Up @@ -836,8 +839,8 @@ def cleanup(self):
pass
self._socket_server = None

# Print overhead summary
if hasattr(self, "_overhead_stats"):
# Print overhead summary (only if verbose)
if hasattr(self, "_overhead_stats") and getattr(self, "verbose", True):
self.print_overhead_summary()

# Unregister from emergency cleanup
Expand Down