feat(v1): persist harnesses over native runtime processes - #2249
feat(v1): persist harnesses over native runtime processes#2249hallerite wants to merge 14 commits into
Conversation
# Conflicts: # skills/evaluate-environments/references/REFERENCE.md # tests/v1/test_e2e.py # verifiers/v1/acp/_runner.py # verifiers/v1/harness.py # verifiers/v1/harnesses/rlm/harness.py # verifiers/v1/rollout.py
afd2fdd to
a1923cd
Compare
# Conflicts: # tests/v1/test_e2e.py # verifiers/v1/__init__.py # verifiers/v1/acp/__init__.py # verifiers/v1/acp/_runner.py
a1923cd to
b915ea7
Compare
ApprovabilityVerdict: Needs human review This PR introduces a new feature for persistent harness sessions across runtime processes, including new abstractions ( You can customize Macroscope's approvability policy. Learn more. |
|
Integration verification: The targeted The temporary workflow step was removed after the successful run. The immutable SDK pin remains until |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit efe7ff6. Configure here.
|
Real-workload validation update (the temporary workflow steps were removed afterward):
Together these cover environment-level interleaving/session resume (Kuhn) and generic modeled-user + nested MCP composition (user-sim) end to end over the pinned native Prime process API. The PR no longer contains the temporary CI diagnostics. |

Summary
This is the native-process counter-proposal to #2116 and #2141:
HarnessSessionownership to the harness lifecycleRuntimeProcesscontract: byte-stream stdout/stderr, stdin, wait, terminate, and kill/tmptmpfsDesign
Persistence is a runtime capability rather than a harness-specific network service. The default
HarnessSessionadapts existinglaunch()/resume()implementations, so only stateful harnesses need a specialized session.Prime live processes are deliberately gated to
runtime.prime.vm=true. Container sandboxes fail with an actionable error because Prime containers are being deprecated.Dependency
Depends on PrimeIntellect-ai/prime#819 for
AsyncSandboxClient.open_process(). Until that SDK change is released, the Prime adapter reports that the installed SDK is too old; the other runtimes work independently.Validation
uv run pytest tests/v1/ -quv run ruff check --fix .uv run pre-commit run --all-filesrlm-acp-in-prime-vmE2E passes: one ACP/RLM process survives two turns, calls its MCP tool on the resumed turn, and tears down cleanlyNote
Persist harness sessions across turns using live native runtime processes
HarnessSessionin harness.py as a rollout-scoped abstraction that replaces per-turnharness.run()calls in rollout.py; default implementation wraps existing launch/resume semantics.RuntimeProcessabstract class andRuntime.open_process()to runtimes/base.py, with concrete implementations for Docker, Modal, Prime (VM-only), and subprocess runtimes.LiveACPSessionthat keeps a single ACP agent process alive across turns, communicating via a framed 8-byte size-prefixed stdio packet protocol; one-shot runs use a separaterun_oncepath.RLMHarness.session()in harnesses/rlm/harness.py to return anACPHarnessSessionbacked by a persistentrlm --acpprocess; per-rollout state is isolated under a trace-specificRLM_HOME.open_processis unsupported on Prime without a VM sandbox or a recent SDK version, raisingSandboxErrorexplicitly; Modal falls back to terminating the entire sandbox if PID acquisition times out.Changes since #2249 opened
Harness.run()coroutine method for one-shot segment execution and refactored result validation intoHarness._check_result()helper method, withHarnessSession.turn()updated to delegate to the new validation helper [7b91006]RLMHarness.session()to conditionally use baseHarness.session()implementation when runtime does not support live processes [7b91006]supports_live_processesproperty toRuntimebase class andPrimeRuntimeto indicate live process capability support [7b91006]prime-sandboxespackage as a git-based dependency source [e69250e]Prime VM persistent RLM E2Ebeforelive v1 E2Es[14ef360]VerifiersClientclass toVerifiersACPClientand updated all instantiation and usage sites [af19253]Macroscope summarized 5f7dc2d.
Note
High Risk
This changes core rollout/harness lifecycle and long-lived sandbox process teardown across Docker, Modal, and Prime VMs; mis-handled sessions could leak processes or drop scoreable trajectories on close failures.
Overview
Rollouts now open a rollout-scoped
HarnessSessionand drive turns viaturn()instead of spawning a fresh harness process each segment. The default session still maps tolaunch()/resume(); stateful transports overrideHarness.session()to keep live state.RuntimeProcessandRuntime.open_process()add stdin/stdout streaming with graceful shutdown across subprocess, Docker, Modal, and Prime (VM-only). ACP gains a long-livedstreamrunner with framed stdio packets plusACPHarnessSession, while one-shot segments useonce.RLM switches to
rlm-harnesswith--acp, using a persistent ACP session when the runtime supports live processes and falling back otherwise. Sandbox tool installs on Prime VMs use the runtime workdir for source/build/uv cache instead of small/tmptmpfs.prime-sandboxesis pinned from git foropen_process. E2E coverage adds RLM ACP resume on Docker and Prime VM.Reviewed by Cursor Bugbot for commit af19253. Bugbot is set up for automated code reviews on this repo. Configure here.