Skip to content

feat(v1): add trainable Prime Agent harness - #2355

Draft
hallerite wants to merge 1 commit into
codex/training-streaming-harnessesfrom
codex/prime-agent-harness
Draft

feat(v1): add trainable Prime Agent harness#2355
hallerite wants to merge 1 commit into
codex/training-streaming-harnessesfrom
codex/prime-agent-harness

Conversation

@hallerite

@hallerite hallerite commented Aug 13, 2026

Copy link
Copy Markdown
Member

Summary

  • add a thin Prime Agent harness on top of the shared ACP harness
  • install a pinned Prime Agent release and route its OpenAI-compatible model calls through Verifiers interception
  • support ACP MCP servers, skills, resume, and appended system prompts
  • isolate per-trace Prime Agent state and daemon sockets while retaining reusable runtime caches

Why

Prime Agent's native model API uses streaming Chat Completions. The harness itself can stay small because the generic renderer-backed streaming bridge now lives in the parent PR, #2369. This PR contains only the Prime Agent integration.

With Prime Agent #1378, ACP-provided MCP tools are translated into session-scoped Python programs by Prime Agent itself. Verifiers supplies the environment's MCP URLs while Prime Agent owns its native tool representation.

Stack and dependency

Validation

  • focused Ruff and formatting checks passed
  • uv run pytest tests/v1 -m 'not e2e' — 70 passed
  • isolated Docker MCP evaluation — reward 1.0
  • real Prime VM + Prime Inference MCP evaluation — reward 1.0; generated MCP Python program executed successfully, no trace errors, sandbox teardown verified

The restacked commit is signed with the contributor's verified SSH signing key. Local push hooks were skipped during the ancestry-only rewrite to avoid heavy local computation; GitHub CI is authoritative for the new commit.



class PrimeAgentHarnessConfig(HarnessConfig):
version: str = Field(default="0.7.3", pattern=r"^[A-Za-z0-9._+-]+$")

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Medium prime_agent/harness.py:40

version=".." resolves the install prefix to /var/tmp, so _bin() later executes /var/tmp/bin/prime-agent outside the version-specific cache and can collide with other runtime tooling. The pattern allows dot-only values; require a version-like alphanumeric prefix before interpolating version into these paths.

Suggested change
version: str = Field(default="0.7.3", pattern=r"^[A-Za-z0-9._+-]+$")
version: str = Field(default="0.7.3", pattern=r"^[A-Za-z0-9][A-Za-z0-9._+-]*$")
🚀 Reply "fix it for me" or copy this AI Prompt for your agent:
In file @verifiers/v1/harnesses/prime_agent/harness.py around line 40:

`version=".."` resolves the install prefix to `/var/tmp`, so `_bin()` later executes `/var/tmp/bin/prime-agent` outside the version-specific cache and can collide with other runtime tooling. The pattern allows dot-only values; require a version-like alphanumeric prefix before interpolating `version` into these paths.

@hallerite
hallerite force-pushed the codex/prime-agent-harness branch from 6f9ecc5 to f053b5b Compare August 15, 2026 01:47
@hallerite
hallerite changed the base branch from main to codex/training-streaming-harnesses August 15, 2026 01:47
[ -x "$prefix/bin/prime-agent" ] && exit 0
export NPM_CONFIG_PREFIX="$prefix"
export PRIME_AGENT_BOOTSTRAP_KERNEL_ON_INSTALL=0
curl -fsSL "$VF_PRIME_AGENT_INSTALL_URL" | sh

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟠 High prime_agent/harness.py:35

A failed download is treated as a successful install: curl exits nonzero, but the downstream sh exits successfully on empty input, so setup continues and only fails later when the wrapper executes the missing binary. Download the installer first so set -e propagates curl failures.

Suggested change
curl -fsSL "$VF_PRIME_AGENT_INSTALL_URL" | sh
curl -fsSL "$VF_PRIME_AGENT_INSTALL_URL" -o "$VF_PRIME_AGENT_DIR/.install.sh"
sh "$VF_PRIME_AGENT_DIR/.install.sh"
rm -f "$VF_PRIME_AGENT_DIR/.install.sh"
🚀 Reply "fix it for me" or copy this AI Prompt for your agent:
In file @verifiers/v1/harnesses/prime_agent/harness.py around line 35:

A failed download is treated as a successful install: `curl` exits nonzero, but the downstream `sh` exits successfully on empty input, so `setup` continues and only fails later when the wrapper executes the missing binary. Download the installer first so `set -e` propagates `curl` failures.

@hallerite
hallerite force-pushed the codex/training-streaming-harnesses branch from 2f63e73 to e46f3e2 Compare August 15, 2026 10:39
@hallerite
hallerite force-pushed the codex/prime-agent-harness branch from f053b5b to 2eed65b Compare August 15, 2026 10:39
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