feat(v1): persist harnesses over native runtime processes - #2249
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 significant new feature: persistent harness sessions over native runtime processes. It adds new abstractions (HarnessSession, RuntimeProcess), a streaming protocol for ACP, implementations across Docker/Modal/Prime/Subprocess runtimes, and modifies the core rollout lifecycle. The scope and complexity of these infrastructure changes warrant human review. 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]promptfunction that raisesRuntimeErrorwhen agent produces empty visible reply [02db586]VerifiersACPClientsession lifecycle [02db586]prime-sandboxesdependency version constraint and removed git source override [0ff6f9a]PrimeRuntime.open_processmethod [da65000]Macroscope summarized 5f7dc2d.
Note
High Risk
Touches core rollout lifecycle, multi-runtime process management, and Prime VM-only live processes; teardown/cancellation paths must not leak sandboxes or discard scoreable traces.
Overview
Rollouts now open a rollout-scoped
HarnessSessionat setup and drive each segment withturn()instead of one-shotharness.run(), so stateful harnesses can keep a live process for the whole interaction.RuntimeProcessandRuntime.open_process()add stdin/stdout streaming with wait/terminate/kill on subprocess, Docker, Modal, and Prime (VM-only). ACP gainsACPHarnessSession: a long-livedstreamrunner with framed stdio packets, whileoncekeeps single-segment behavior. RLM moves torlm-harnesswith--acp, uses persistent ACP whensupports_live_processes, and isolates state per trace.Sandboxed MCP installs now use the runtime workdir for source/uv cache (avoiding Prime VM
/tmpexhaustion).prime-sandboxesis bumped to 0.2.35; E2E adds RLM ACP resume on Docker and Prime VM.Reviewed by Cursor Bugbot for commit da65000. Bugbot is set up for automated code reviews on this repo. Configure here.