Skip to content

Comments

RLM: Add RLMEnv sandbox hooks for safer customization#849

Merged
snimu merged 2 commits intomainfrom
sebastian/rlm-sandbox-paths-override-allowed-2026-02-06
Feb 7, 2026
Merged

RLM: Add RLMEnv sandbox hooks for safer customization#849
snimu merged 2 commits intomainfrom
sebastian/rlm-sandbox-paths-override-allowed-2026-02-06

Conversation

@snimu
Copy link
Contributor

@snimu snimu commented Feb 7, 2026

Description

  • Allow environments to override sandbox creation, post‑create setup, and worker script generation via get_sandbox_request, on_sandbox_ready, and customize_worker_script.
  • Ensure rlm_fs_root_remote / rlm_control_dir_remote can be pre‑set before eager sandbox startup.
  • Document the hooks and override patterns.

Custom envs (e.g., mini‑swe) previously had to fork the executor to adjust sandbox setup or worker scripts. These hooks centralize the logic in RLMEnv, reduce duplication, and keep eager startup compatible with pre‑existing filesystem roots.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Test improvement

Testing

  • All existing tests pass when running uv run pytest locally.
  • New tests have been added to cover the changes

Checklist

  • My code follows the style guidelines of this project as outlined in AGENTS.md
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • Any dependent changes have been merged and published

Note

Medium Risk
Changes the RLM sandbox startup lifecycle (creation, readiness waiting, and worker script generation), which could impact sandbox rollouts and error handling if hooks misbehave.

Overview
RLMEnv now exposes override hooks to customize sandbox-backed rollouts without forking the executor: get_sandbox_request(state) for per-rollout sandbox configuration, on_sandbox_ready(state, sandbox_id) for post-create setup before the worker starts, and customize_worker_script(script, state) to tweak the generated worker script (applied for both local and sandbox workers).

Sandbox setup now preserves pre-set state["rlm_fs_root_remote"]/state["rlm_control_dir_remote"] via setdefault, and captures simple sandbox readiness timing in state["sandbox_state"]. Documentation in docs/environments.md and verifiers/envs/experimental/README.md is updated to describe these hooks and the pre-set remote path behavior.

Written by Cursor Bugbot for commit 9f14410. This will update automatically on new commits. Configure here.

@snimu snimu merged commit ff9a6ae into main Feb 7, 2026
6 checks passed
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