Skip to content

feat(v1): integrate nano-RLM training over ACP - #2439

Merged
hallerite merged 4 commits into
mainfrom
codex/nano-rlm-on-typed-acp
Aug 26, 2026
Merged

feat(v1): integrate nano-RLM training over ACP#2439
hallerite merged 4 commits into
mainfrom
codex/nano-rlm-on-typed-acp

Conversation

@hallerite

@hallerite hallerite commented Aug 25, 2026

Copy link
Copy Markdown
Member

Summary

  • run nano-RLM through the generic typed ACP prompt lifecycle
  • pass its runtime-v1 execution policy and credentials at session creation
  • consume cumulative session metrics from successful PromptResponse._meta, not session/close
  • validate only the session id and metrics Verifiers consumes while allowing additive snapshot fields
  • pin nano-RLM to the exact producer commit from nano-RLM PR #144
  • retain MCP, resume, recursive branches, credential isolation, skills, and cumulative metrics

Stack

PR 2 of the three-PR Verifiers stack. This targets typed ACP base PR #2438. Its exact nano-RLM dependency is 11dcb9c353f1f7c89c8c6f1bc0ddea33b3cffa19 from nano-RLM #144.

Validation

  • full Verifiers suite on the combined stack — 919 passed, 77 credential-gated skips
  • nano-RLM full suite — 123 passed
  • live Prime VM contract E2E against the exact pin — passed
    • two concurrent recursive children
    • three expected training branches
    • MCP after resume
    • kernel credential isolation
    • prompt-boundary recursive metrics
  • changed-file pre-commit hooks and push-hook CI-parity type check

Note

Medium Risk
Moves API keys and execution policy from env vars into ACP session metadata and changes the metrics contract; mis-validation or metadata drift could break rollouts or drop training signals.

Overview
The RLM harness stops wiring nano-RLM through RLM_* environment variables and instead supplies a typed ai.prime.rlm/runtime-v1 payload on ACPConfig.session_meta at session creation (model, provider credentials, policy, skills, kernel env, etc.). prepare_acp now keeps only resolved_env plus RLM_HOME in subprocess env.

Compaction policy is expressed as int | None in that metadata (including per-task random thresholds) instead of string env values.

Rollout metrics no longer come from a @metric helper that shells out to read sessions/*/meta.json. acp_turn_result validates ai.prime.rlm/session-v1 with _SessionSnapshot, checks session_id against the trace, and calls trace.record_metrics.

The default nano-rlm install pin is updated to 5ee1c34024a183bbbd3a38a6129995f5b982631d.

Reviewed by Cursor Bugbot for commit a15fcc6. Bugbot is set up for automated code reviews on this repo. Configure here.

@macroscopeapp

macroscopeapp Bot commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Not approved

Macroscope's review found this PR not approvable — This PR changes the training-critical RLM execution path, including ACP session metadata, provider credential propagation, concurrency policy, dependency pinning, and metric collection. The combined runtime and sensitive-data impact warrants human review.

Not approved because:

  • Monthly spending limit reached (workspace setting). Approvability relies on correctness review in order to determine eligibility

Review your spending limits in Billing settings. You can add or adjust custom eligibility rules. Learn more.

Comment thread tests/v1/test_rlm_prime_contract.py Outdated
Comment thread verifiers/v1/harnesses/rlm/harness.py Outdated
Comment thread verifiers/v1/harnesses/rlm/harness.py Outdated

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit ea4935b. Configure here.

Comment thread verifiers/v1/harnesses/rlm/harness.py
Comment thread verifiers/v1/harnesses/rlm/harness.py
mikasenghaas
mikasenghaas previously approved these changes Aug 26, 2026
stack merge was automatically disabled August 26, 2026 00:36

Pull Request is not mergeable

stack merge was automatically disabled August 26, 2026 00:41

Pull Request is not mergeable

stack merge was automatically disabled August 26, 2026 00:44

Pull Request is not mergeable

stack merge was automatically disabled August 26, 2026 00:44

Pull Request is not mergeable

Base automatically changed from codex/typed-acp-base to main August 26, 2026 00:44
@hallerite
hallerite merged commit ca941d3 into main Aug 26, 2026
9 of 13 checks passed
@hallerite
hallerite deleted the codex/nano-rlm-on-typed-acp branch August 26, 2026 00:45
mikasenghaas pushed a commit that referenced this pull request Aug 26, 2026
## Summary

- update the RLM harness to consume the ACPTurn type exported by the
merged ACP base
- restore built-in harness discovery after stacked PR #2439 was
restacked onto PR #2438

## Root cause

PR #2439 retained the earlier ACPTurnResult name while PR #2438 landed
the public type as ACPTurn. Importing the built-in harness package
therefore raised ImportError.

## Validation

- exact deterministic V1 CI command: 71 passed
- full test suite: 915 passed, 75 credential-gated skips
- uv run ty check verifiers
- uv run ruff check --fix .
- changed-file pre-commit hooks

The all-files Markdown hook still reports the pre-existing inline-HTML
table in
verifiers/legacy/envs/experimental/composable/tasksets/swe/README.md, as
already documented in PR #2438.

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Low Risk**
> Type-name alignment only; no change to RLM turn handling or metrics
recording logic.
> 
> **Overview**
> Updates the **RLM harness** so it imports and uses **`ACPTurn`** from
`verifiers.v1.acp` instead of the obsolete **`ACPTurnResult`** name on
the import and on **`acp_turn_result`**.
> 
> This matches the public ACP base type from the merged stack and fixes
**`ImportError`** when built-in harness discovery loads the RLM package.
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
3d87235. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
hallerite added a commit that referenced this pull request Aug 26, 2026
## Summary

- add Prime Agent over the same generic typed ACP prompt lifecycle as
nano-RLM
- pass `--autonomous` explicitly from harness configuration
- preserve MCP programs, resume state, skills, Chat reasoning lineage,
and isolated per-rollout state
- trust Prime Agent's completed `session/prompt` boundary from [Prime
Agent PR
#1612](PrimeIntellect-ai/prime-agent#1612)
- record response-boundary and terminal-quiescence telemetry for
evidence without making it a second completion gate
- enforce single-branch lineage for the ordinary two-turn resume case

## Stack

PR 3 of the three-PR Verifiers stack. This targets nano-RLM integration
PR #2439, which targets typed ACP base PR #2438.

Prime Agent PR #1612 is merged and included in the pinned beta used
here. It makes `session/prompt` wait for recursive terminal quiescence
and returns the final autonomous stop reason.

## Validation

- full Verifiers suite on the combined stack — 919 passed, 77
credential-gated skips
- Prime Agent Prime VM MCP/resume E2E — passed against
`0.8.0-beta.548.1.9bc0055`
- single-branch assertion enabled and passed for the resumed
conversation
- Seth's full feature canary against current Prime Agent `main`
(`9bc0055`) — passed
  - reward `1.0`; all 13 feature checks true
  - retained-child follow-up acknowledged and child deleted
  - terminal quiescence after response boundary
  - zero outstanding subagents and autonomous continuations
  - Docker container removed
- changed-file pre-commit hooks and push-hook CI-parity type check

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Medium Risk**
> Introduces network-fetched agent binaries and a new ACP harness on the
eval critical path; the RLM default pin change can shift behavior for
existing RLM rollouts.
> 
> **Overview**
> Adds a **Prime Agent** v1 harness that runs Prime Agent in native
**ACP mode** on the shared `ACPHarness` path, with MCP, resume, skills,
and optional **`autonomous`** continuation via config.
> 
> The harness **bootstraps a pinned beta** from GitHub releases
(checksum-verified tarballs, global npm install under a commit-keyed
prefix), wires the **intercept** provider to the eval endpoint, and
keeps **per-rollout state** (models config, daemon socket, wrapper).
After each ACP turn it **records lifecycle telemetry**
(`responseBoundary`, `terminalQuiescence`, infrastructure status) under
`trace.info["acp_lifecycle"]` for evidence without gating completion on
it.
> 
> **E2E** gains a Prime VM row for `prime-agent` in the ACP resume+MCP
test, asserting two turns show OK infrastructure and zero outstanding
subagents at terminal quiescence. **nano-RLM**’s default install ref is
bumped to a newer commit.
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
9af8996. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
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.

2 participants