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
13 changes: 12 additions & 1 deletion verifiers/envs/experimental/rlm_env.py
Original file line number Diff line number Diff line change
Expand Up @@ -1721,7 +1721,9 @@ def __init__(self, env: "RLMEnv") -> None:
super().__init__(env)
self._sessions: dict[str, LocalRLMReplSession] = {}
self._retained_dirs: set[str] = set()
self._io_executor = ThreadPoolExecutor(max_workers=4)
self._io_executor = ThreadPoolExecutor(
max_workers=self.env.local_repl_max_workers
)

def create_rollout_dirs(self, state: State) -> None:
session = self._get_or_create_session(state)
Expand Down Expand Up @@ -2669,6 +2671,7 @@ class RLMEnv(vf.StatefulToolEnv):
sandbox_client_max_workers: Sandbox client pool size (default: 10)
sandbox_client_max_connections: Sandbox client max connections (default: 100)
sandbox_client_max_keepalive_connections: Sandbox client keepalive conns (default: 50)
local_repl_max_workers: Max worker threads for local REPL execution.
**kwargs: Additional arguments passed to StatefulToolEnv
"""

Expand Down Expand Up @@ -2716,6 +2719,7 @@ def __init__(
sandbox_client_max_workers: int = 10,
sandbox_client_max_connections: int = 100,
sandbox_client_max_keepalive_connections: int = 50,
local_repl_max_workers: int | None = None,
Copy link

Choose a reason for hiding this comment

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

Missing documentation for new configuration parameter

Low Severity · Bugbot Rules

The PR adds a new user-facing parameter local_repl_max_workers to RLMEnv, but the documentation in docs/environments.md is not updated to reflect this. The existing RLMEnv documentation at line 775 describes various configuration options but doesn't mention this new concurrency setting. Per the project's review rules, documentation updates are required when adding user-facing functionality to classes described in docs/.

Fix in Cursor Fix in Web

Copy link
Contributor Author

Choose a reason for hiding this comment

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

docs for the rlm will have to be properly updated in another PR; right now, it changes so quickly that this doesn't make sense (and a bunch of other args are un-documented as well). Will do this later.

rubric: Rubric | None = None,
**kwargs,
):
Expand Down Expand Up @@ -2792,6 +2796,13 @@ def __init__(
self.sandbox_client_max_keepalive_connections = (
sandbox_client_max_keepalive_connections
)
self.local_repl_max_workers = (
local_repl_max_workers
if local_repl_max_workers is not None
else max(1, min(64, os.cpu_count() or 1))
)
if self.local_repl_max_workers < 1:
raise ValueError("local_repl_max_workers must be >= 1")
# Server-side timeout for LLM API calls (shorter than worker HTTP timeout)
# This ensures server responds before the worker request times out
(
Expand Down
Loading