Repository navigation
feat(prime-agent): adapt Prime Intellect's Prime Agent over ACP - #62
Conversation
Declarative manifest for prime-agent 0.7.1 (self-hosted npm tarball release): - ACP mode is in-process; model selection is env-owned (no ACP set_model) - /opt-anchored uv kernel venv (Python 3.11 + bundled prime-agent-runtime) pre-provisioned at install so first tool use is offline and works under the dropped-privilege sandbox user - launcher generates models.json from BENCHFLOW_PROVIDER_* env; API key is referenced by env-var name, never written to disk - DeepSeek model ids mirror the full effective native compat: prime-agent's base-URL compat autodetection flips behind a proxy and sends the 'developer' role, which DeepSeek's real API 400s (verified live); the explicit compat keeps wire behavior identical to a native run
…shness test Review follow-ups: - pin the release tarball to its official SHA256SUMS digest (the R2 bucket is a mutable trust anchor; Prime Intellect's own installer verifies the same) - launcher: fail fast on JSON-unsafe model/base strings and on a missing API key env var; case-insensitive DeepSeek compat match; document why proxy/TLS env is stripped (wire parity with native runs) - contract: generic freshness test — every acp/*/launcher.sh must match its manifest's embedded base64 blob byte-for-byte (pi-acp precedent)
|
Structural review done (approve): added a generic launcher-embed freshness test (contract/), checksum-pinned the release tarball against Prime Intellect's official SHA256SUMS, and hardened the launcher (JSON-unsafe input guard, API-key preflight, case-insensitive DeepSeek match, documented proxy-env stripping). Contract tests: 21 passed; the only failure on this branch is the pre-existing corust-agent schema violation from main. Full 87-task SkillsBench sweep + second 10-task trial are running; numbers to follow. |
|
87-task SkillsBench sweep (deepseek-v4-pro, Daytona conc 30) — stopped early on request; results from the 70 rollouts that ran:
Note for reruns: per repo owner's testing policy, future DeepSeek runs use |
|
Final head-to-head parity: original prime-agent vs benchflow-adapted, 25 SkillsBench tasks, deepseek-v4-flash, 1 trial/arm. Arm A = repo-official install (
Agreements include 8 joint passes and 7 joint failures. Verdict: no directional adaptation effect at 1-trial resolution (detection floor ~15-20pp); combined with the byte-identical request #0 wire evidence, the adapted agent is behaviorally the original. Arm A also surfaced: the official installer refuses headless Node bootstrap ("No terminal detected") — the manifest's own Node provisioning is required for sandbox use, documented in the README. Unpaired (B-side infra, not agent): fix-build-agentops, fix-build-google-auto, jax-computing-basics, quantum-numerical-simulation, xlsx-recover-data. Harness issues found while running this (filed separately): a Daytona PTY hang that evades both watchdogs, and wall-clock-timeout rollouts inconsistently skipping the verifier (reward=None vs scored). |
prime-agent (and any agent that lists bundled skills in its system prompt) embeds the agent INSTALL PREFIX in each <location> tag. Standalone installs live under the host npm prefix; BenchFlow installs under /opt/benchflow — same skill set, different mount point: the same environment-placement class as cwd. The rule collapses only the prefix ahead of the dist/skills/ tail inside a <location> tag, so a different skill NAME or an extra/missing entry still FAILs. Found running the mock-upstream wire-parity protocol against prime-agent on Daytona.
…cipe
- single-text-part-vs-string: [{type:text,...}] vs bare string content —
the same model input; LiteLLM provider transforms flatten the array
form. Different text or a multi-part array still FAILs.
- blank-reasoning-content: '' vs ' ' replayed reasoning_content (LiteLLM
pads the empty string). Non-blank reasoning compares verbatim.
- docs/parity.md: the Daytona variant of the mock-upstream recipe
(in-sandbox mock via setup_commands + verifier exfiltration), including
the session-exec backgrounding landmine, and why wire claims need a
capture at the mock rather than the gateway trace log.
With these, the full protocol run against prime-agent on Daytona PASSES:
multi-turn byte-identical under the sanctioned allowlist, with thinking +
reasoning_effort verified ARRIVING at the upstream (after the benchflow
gateway fixes in benchflow-ai/benchflow#949).
|
Protocol-exact wire parity: PASS. Ran the adaptation-parity skill's mock-upstream check end-to-end on Daytona (in-sandbox mock; recipe now in docs/parity.md): the full multi-turn request sequence is byte-identical native-vs-benchflow under the sanctioned NEUTRAL_DIFFS, with The protocol run earned its keep twice: (1) it caught benchflow's gateway silently dropping agent-sent Caveat for the record: the earlier 25-task outcome A/B predates the gateway fix, so its benchflow arm ran with DeepSeek's default thinking config rather than the agent's explicit one — arms still scored equal means, and the wire is now verified identical going forward. |
feat(prime-agent): adapt Prime Intellect's Prime Agent over ACP
Adapts Prime Agent — Prime Intellect's self-improving RLM coding agent (MIT, released 2026-08-06, built on pi) — as a declarative manifest package at
acp/prime-agent/.Design
prime-agent --mode acpis in-process (no daemon), stdio JSON-RPC, one session per connection — matches BenchFlow's ACP client exactly. The agent's single model-facing tool is a persistent IPython kernel./opt/benchflow/prime-agent/kernel-venv(uv-managed Python 3.11 + ipykernel + the tarball's bundledprime-agent-runtime+ default RLM packages). Everything is/opt-anchored so it works identically under the dropped-privilege sandbox user; first tool use needs no network.set_model):supports_acp_set_model = false+BENCHFLOW_PROVIDER_MODELinenv_mappingengages core's model-via-env path (verified in run logs: "Skipping ACP model configuration"). The launcher generates amodels.jsoncustom provider fromBENCHFLOW_PROVIDER_*; the API key is referenced by env-var name, never written to disk.The compat landmine this PR documents and defuses
Prime Agent auto-detects provider compatibility from the base URL (
resolveCompat,packages/ai/src/providers/openai-completions.ts):isNonStandardmatchesbaseUrl.includes("deepseek.com")but notprovider === "deepseek". Behind any proxy base URL the detection flips and the agent sends the system prompt as thedeveloperrole (plusstore), which DeepSeek's real API rejects with a 400 (verified live; LiteLLM masks it by translating the role — i.e. a silent native-vs-benchflow divergence). The launcher therefore mirrors the full effective native compat for DeepSeek ids explicitly (supportsDeveloperRole=false,supportsStore=false,maxTokensField=max_completion_tokens,thinkingFormat=deepseek,requiresReasoningContentOnAssistantMessages=true, catalogcontextWindow/maxTokens/thinkingLevelMap). This generalizes to any pi-family agent run through a gateway.Verification (Daytona + DeepSeek)
citation-check— reward 1.0, 19 tool calls, 18 gateway-traced LLM roundtrips,usage_source=provider_response, cost $0.008 (deepseek-v4-flash; DeepSeek thinking +reasoning_effort=highsurvive the gateway).max_completion_tokens,stream_options) that LiteLLM's post-parse trace view consumes (capture artifact — the response's usage confirmsinclude_usagetook effect).reward 0.0accounting — the intended backstop for kernel-based agents.deepseek-v4-pro, Daytona conc 10): 9/10 healthy rollouts (all with real tool calls + token accounting), 3 passes (3d-scan-calc,hvac-control,threejs-to-obj), 1 task wall-clock timeout (task budget respected), 1 infra failure unrelated to this agent (suricata-custom-exfil's image ships Python 3.9, which can't host the sandbox-local LiteLLM — benchflow-core issue, tracked separately). A full 87-task sweep + a second trial are running; results in PR comments.-pwith direct DeepSeek creds — no ACP, no gateway):citation-checknative 1.0 = benchflow 1.0;lake-warming-attribution(v4-pro) native 0.0 = benchflow 0.0. Arms agree on both success and failure.Notes
-pprint mode reads piped stdin until EOF — drivers must close stdin.acp/corust-agent/manifest.tomlfails the contract schema (acp_model_format = "prefixed"), i.e.contract/tests are red on main before this PR (fix tracked separately).