Skip to content

feat(agent): run the Agenta harness on the rivet/ACP backend with forced skills#4782

Open
mmabrouk wants to merge 1 commit into
integration/agenta-rivet-basefrom
feat/agenta-on-rivet
Open

feat(agent): run the Agenta harness on the rivet/ACP backend with forced skills#4782
mmabrouk wants to merge 1 commit into
integration/agenta-rivet-basefrom
feat/agenta-on-rivet

Conversation

@mmabrouk

Copy link
Copy Markdown
Member

Context

The "Agenta" harness is Pi with a fixed opinion: a base AGENTS.md preamble, a persona, forced read/bash tools, and forced skills. It only ran on the in-process Pi backend. The moment a run went through the rivet/ACP backend (which happens when AGENTA_AGENT_RUNTIME=rivet is set, a non-local sandbox is picked, or the playground Harness dropdown selects Agenta), the runner sent the agent id agenta to the rivet daemon. The daemon only knows real agents (pi, claude), so it answered Unsupported Agent: agenta. That rejection surfaced as an unhandled promise rejection that never resolved the request, so the playground sat on "Generating response…" forever.

Changes

The Agenta harness runs on the same engine as Pi, so the rivet daemon should drive it as the pi agent. The runner now maps agenta -> pi once (acpAgent) and uses acpAgent for every daemon operation (session creation, capability probe, model resolution, daemon env, the harness key var). harness ("agenta") stays the user-facing identity for logs, the trace span label, and error text.

RivetBackend.supported_harnesses now includes AGENTA, so select_backend routes agenta to rivet for a non-local sandbox or AGENTA_AGENT_RUNTIME=rivet instead of raising UnsupportedHarnessError.

Forced skills cannot ride the /run wire as text (a skill is a directory of files), so the wire carries only the skill names and the runner lays the bundled directories onto disk where Pi auto-discovers them. They go into the Pi user-scope agent dir (<agentDir>/skills/), the only place pi-acp loads them in a headless run (project skills under <cwd>/.pi/skills/ are trust-gated). Because that dir is shared across runs, an Agenta run gets a throwaway per-run agent dir seeded from the login, with the extension and skills installed into it and the daemon pointed at it; it is removed after the run. A plain pi run is unchanged. On Daytona the sandbox is already fresh per run, so the skills upload through the sandbox FS API.

Before: selecting Agenta on the rivet path raised AcpHttpError: Unsupported Agent: agenta and the request hung.
After: Agenta runs as Pi, loads the agenta-getting-started skill, and the model reads it.

Tests / notes

  • Python: extended test_select_backend.py (agenta+daytona and runtime=rivet route to rivet) and test_harness_adapters.py (RivetBackend.supports(AGENTA)). Service and SDK agent suites pass.
  • TS: added test/skills.test.ts for the shared resolveSkillDirs; all 8 runner tests pass.
  • Verified live on the dev box: an Agenta run on the rivet path loaded the skill and the model quoted its first bullet. /pi-agent/skills stayed empty afterward (no leak) and a following plain-pi run did not see the skill.
  • The dev image gap is closed: Dockerfile.dev now bakes skills/ (matching prod) and the dev compose bind-mounts it.
  • Known gap, documented in adapters/agenta.md: the persona appendSystemPrompt is not delivered on the ACP Pi path (pi-acp has no per-run hook); the base AGENTS.md and read/bash still apply. Daytona skill upload is UTF-8 text only.
  • Stacking: this PR is based on integration/agenta-rivet-base, a branch that merges the in-flight agent-workflows series this change depends on (SDK, service, runner-tools, runner-engines, hosting, docs), so the diff here is exactly these 11 files. Rebase onto the relevant branch once those land.

What to QA

  • Open the Agent app in the playground, set Harness = Agenta, Sandbox = Local, send a message. It answers (no infinite spinner).
  • Ask it to read its agenta-getting-started skill. It quotes the skill content, and the turn's token count is higher than a no-skill turn.
  • Regression: switch Harness back to Pi and send a message. It still answers and does not mention the Agenta skill.

…ced skills

The Agenta harness (Pi plus a forced base AGENTS.md, persona, tools, and
skills) only ran on the in-process Pi backend. Selecting it on the rivet path
(AGENTA_AGENT_RUNTIME=rivet, a non-local sandbox, or the playground Harness
dropdown) sent the agent id "agenta" to the rivet daemon, which only knows
real agents (pi/claude) and answered "Unsupported Agent: agenta". The
rejection never resolved the request, so the playground spun forever.

Map "agenta" onto the "pi" ACP agent (acpAgent) for every daemon operation,
keeping "agenta" as the user-facing identity. Add AGENTA to
RivetBackend.supported_harnesses so select_backend routes it. Deliver the
forced skills by laying the bundled dirs into a per-run Pi agent dir (so they
never leak into later plain-pi runs) for local, and uploading them to the
fresh sandbox for Daytona.
@dosubot dosubot Bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Jun 20, 2026
@vercel

vercel Bot commented Jun 20, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
agenta-documentation Ready Ready Preview, Comment Jun 20, 2026 9:00am

Request Review

@dosubot dosubot Bot added the enhancement New feature or request label Jun 20, 2026
@coderabbitai

coderabbitai Bot commented Jun 20, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: d7cec032-3817-431b-992b-d39d048f6719

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/agenta-on-rivet

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions

Copy link
Copy Markdown
Contributor

Railway Preview Environment

Preview URL https://gateway-production-f2e1.up.railway.app/w
Project agenta-oss-pr-4782
Image tag pr-4782-79e5ee5
Status Deployed
Railway logs Open logs
Workflow logs View workflow run
Updated at 2026-06-20T09:11:52.901Z

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant