feat(v1): add rollout-scoped harness sessions - #2141
Conversation
ApprovabilityVerdict: Needs human review 1 blocking correctness issue found. This PR adds a significant new feature (rollout-scoped ACP sessions) with new abstractions, Unix socket IPC, and sidecar process management. The scope and complexity of new runtime behavior, plus an unresolved comment about error handling in the probe operation, warrant human review. No code changes detected at You can customize Macroscope's approvability policy. Learn more. |
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 7832cb5. Configure here.
36a3732 to
b8e442c
Compare
mikasenghaas
left a comment
There was a problem hiding this comment.
Keeps existing harnesses on a default launch/resume adapter, so taskset and harness authors do not need to migrate.
not a huge fan of dual apis. would prefer we break this and tell ppl to migrate. also, frankly dont believe we have many user-authored harnesses
|
solved with #2249 |

Counter-proposal to #2116.
What changed
HarnessSessionwithturn()andclose().RolloutRuncreate, retain, and close that handle around the full interaction.rlm-harness --acp, preserving its conversation and IPython state across segments while exposing MCP servers as RLM skills.Why this shape
PR #2116 attaches persistence to individual
ACP.run()calls through asidecar_path, leaving RLM responsible for choosing and cleaning up that transport detail. This proposal makes the rollout lifecycle session-shaped instead:RolloutRunowns the handle, while RLM only selects an ACP-backed implementation.The current
Runtimecontract still returns completedProgramResults and cannot expose a provider-neutral live bidirectional process. ACP therefore still uses a private runtime-local socket supervisor underneath. That mechanism is hidden behind the session implementation, so a futureRuntime.open_process()primitive can replace it without changing rollout orchestration or RLM again.The lifecycle also closes the session before interception/tool teardown and scoring, treats teardown failures as best-effort after generation has completed, and fixes the unresolved #2116 disconnect race by cancelling and awaiting the tracked ACP prompt before the request wrapper releases session ownership.
Validation
uv run pytest tests/— 909 passed, 64 skipped (live-key cases)uv run pre-commit run --all-filesuv run --python 3.13 ty check verifiersNote
Add rollout-scoped persistent harness sessions to the ACP runner
HarnessSessionin harness.py as a rollout-scoped abstraction that manages per-turn execution, error handling, and teardown across a rollout's lifetime.ACPin acp/init.py with asession()factory and sidecar lifecycle management (start, probe, route, shutdown) over a Unix domain socket.LiveACPSessionand aserve_sessionsidecar server in _runner.py, implementing a framed JSON IPC protocol and CLI operations:once,serve,request,shutdown, andprobe.RLMHarnessin harnesses/rlm/harness.py to use persistent ACP sessions viaopen_session(), store RLM state in a per-trace private directory, and clean it up on rollout teardown.RolloutRunin rollout.py now opens a harness session at rollout start and routes each segment throughsession.turn(), with cancellation-safe abort and close paths.Macroscope summarized b8e442c.
Note
Medium Risk
Long-lived ACP sidecars per rollout and new teardown paths under cancellation; failed shutdown can leave sockets/processes until retry, but generation errors are no longer masked by close failures.
Overview
Rollout orchestration is now session-shaped:
RolloutRunopens aHarnessSessionat boot, drives each segment viasession.turn(), and closes it (with cancellation-safe retry) before scoring and teardown. The default session still maps tolaunch/resume; stateful harnesses overrideopen_session().ACP gains a runtime-local Unix-socket sidecar (
serve/request/probe/shutdown) so one agent process and ACP connection survive across turns.ACPHarnessSessionowns the sidecar per rollout; disconnect during an active prompt cancels the tracked prompt before teardown.RLM switches from direct CLI to
rlm-harnessat a pinned commit, runs viarlm --acp, wires MCP through the ACP session (notRLM_MCP_CONFIG), and stores state under.vf-rlm/<trace.id>/withcleanup()on rollout end. Docs and e2e add RLM to ACP resume coverage and assert compaction metrics.Reviewed by Cursor Bugbot for commit b8e442c. Bugbot is set up for automated code reviews on this repo. Configure here.