Skip to content

refactor(agent): remove legacy in-process backend, rename harnesses pi_core/pi_agenta#4833

Merged
mmabrouk merged 2 commits into
big-agentsfrom
refactor/agent-harness-rename
Jun 25, 2026
Merged

refactor(agent): remove legacy in-process backend, rename harnesses pi_core/pi_agenta#4833
mmabrouk merged 2 commits into
big-agentsfrom
refactor/agent-harness-rename

Conversation

@mmabrouk

@mmabrouk mmabrouk commented Jun 24, 2026

Copy link
Copy Markdown
Member

Context

The deployed agent service always uses the sandbox-agent backend. The in-process Pi engine (engines/pi.ts) and the backend wire field that selected it were dead code. Separately, the harness values pi and agenta were undescriptive: both drive the Pi agent, but one adds Agenta-forced skills and policy. The names did not communicate that distinction.

This is a pre-production contract, so there is no backward-compat burden and no deprecation shim.

Changes

Two coupled contract changes:

  1. Remove the legacy in-process Pi backend. Deleted engines/pi.ts, the backend engine selector on the /run wire, and the AGENT_BACKEND plumbing. The runner now drives one engine; harness selects the agent.
  2. Rename harness values for clarity: pipi_core, agentapi_agenta (claude unchanged). Both pi_core and pi_agenta still drive the ACP agent pi; pi_agenta is Pi with Agenta's forced skills/prompt/policy.

Rename map

old harness value new harness value
pi pi_core
agenta pi_agenta
claude claude (unchanged)

The backend wire field is removed. Python symbols/class names (HarnessType.PI, PiAgentConfig, AgentaAgentConfig) are unchanged; only the enum string .value moved.

Before / after

  • /run request: {"backend": "sandbox-agent", "harness": "pi", ...}{"harness": "pi_core", ...} (no engine selector).
  • version.ts: ENGINES = ["pi","sandbox-agent"]["sandbox-agent"]; HARNESSES = ["pi","claude","agenta"]["pi_core","claude","pi_agenta"].
  • Golden run_request.pi.jsonrun_request.pi_core.json; both goldens drop backend.

Also in this PR

  • Single-source agent-config default. The default was hand-maintained in three places (the SDK builtin interface, the service /inspect schema, the catalog field defaults), each hand-edited by this rename. Collapsed to one build_agent_v0_default(...) builder in the SDK; the service passes its only extras (the platform skill slug, the sandbox boundary) as named args. New acceptance test pins /inspect default == runtime.
  • Doc-accuracy fix. Corrected the stale protocol.ts SandboxPermission comment: the network policy is enforced on Daytona; the local sidecar rejects a restricted-network run under strict; filesystem is declared-only.

External integrations (Composio / the tool gateway / connections / MCP / Daytona) are unchanged by this PR.

Scope / risk

Python enum .value strings changed. Any caller that constructs a /run body by hand with "harness": "pi" or "harness": "agenta" will get a validation error from the new runner. The Python SDK HarnessType enum values changed, so code that serializes them to strings needs to pick up the new SDK. No database migration; harness values are not persisted.

Tests (all green)

  • Runner: tsc clean, 25 files / 160 tests.
  • SDK: unit 940, integration (agents transport roundtrip) 4.
  • Service agent: 34 (incl. the new default-builder acceptance test).
  • Frontend: playground 26, entity-ui connectionUtils 18.

Notes

  • This is a contract + frontend + golden-fixture change, left for human review. Not merged into big-agents.
  • Stacked on chore/agent-remove-load-session (base of this PR) because it owns the shared docs this PR also edits.
  • Precision preserved: the connection mode agenta (Connection.mode), the ACP agent id pi, and RuntimeAuthContext.backend are different concepts and were not renamed.

How to QA

Prerequisites: Local dev stack with the agent sidecar running (SDK + services/agent/ Node runner, or run.sh with the --dev flag). Python SDK installed from the updated branch.

Steps:

  1. Send a /run request with the old harness value and confirm rejection:
    curl -X POST http://localhost:8090/run \
      -H "Content-Type: application/json" \
      -d '{"harness": "pi", "messages": []}' -v
    # Expected: 400 / validation error
  2. Send a /run request with the new harness value and confirm acceptance:
    curl -X POST http://localhost:8090/run \
      -H "Content-Type: application/json" \
      -d '{"harness": "pi_core", "messages": []}' -v
    # Expected: 200 (or a streaming response / error about missing config, but NOT a 400 for an unknown harness)
  3. Confirm backend is no longer a valid /run field by including it:
    curl -X POST http://localhost:8090/run \
      -H "Content-Type: application/json" \
      -d '{"harness": "pi_core", "backend": "sandbox-agent", "messages": []}' -v
    # Expected: the field is silently ignored or a validation error, NOT a backend-selector dispatch
  4. Open the agent playground for any app; confirm the harness dropdown shows pi_core and pi_agenta (not pi / agenta).

Expected result: Old harness strings fail validation; new strings are accepted. The playground form labels match the new values.

Automated tests:

# Runner (Node)
cd services/agent && pnpm test

# SDK Python
cd sdks/python && uv run python -m pytest oss/tests/pytest/unit/agents/ -n0 -v

# Service agent unit
cd services/oss && uv run python -m pytest tests/pytest/unit/agent/ -n0 -v

Edge cases: A stored agent config with harness: "pi" in the database would fail to apply after this rename. Confirm no migration is needed (the harness value is set at request time from a fresh /inspect, not read back from a stored config blob).

https://claude.ai/code/session_01GYo3UEfvsZpncagqb28Mbc

…i_core/pi_agenta

The deployed agent service always runs the sandbox-agent backend (app.py select_backend),
so the in-process Pi path was dead. Remove it and the `backend` wire selector, and make the
harness names explicit: `pi` -> `pi_core`, `agenta` -> `pi_agenta` (`claude` unchanged). Both
pi_core and pi_agenta still drive the ACP agent "pi"; pi_agenta is Pi with Agenta's forced
skills/prompt/policy. No backward compatibility (the feature is not in production).

Removed:
- runner engines/pi.ts (in-process engine) and its sandboxPermission guard
- the backend branch + AGENT_BACKEND handling in cli.ts/server.ts (always runSandboxAgent)
- the `backend` field from protocol.ts AgentRunRequest and wire.py request_to_wire
- the _ENGINE constant + AGENT_BACKEND env injection in the SDK sandbox_agent backend
- `pi` from version.ts ENGINES (now ["sandbox-agent"])

Renamed harness enum VALUES (Python symbols/class names unchanged): HarnessType enum,
RunSelection default, capabilities table keys, version.ts HARNESSES, run-plan.ts acpAgent
remap, the agent_config catalog type, the service schemas default, and the FE
connectionUtils map + playground/transport defaults. Golden run_request.pi.json ->
run_request.pi_core.json; both goldens drop `backend`.

Also collapsed the agent-config default (it was hand-maintained in three places, each edited
by this rename) into one shared build_agent_v0_default builder in the SDK, consumed by the
builtin interface (bare) and the service (with the platform skill + sandbox boundary as named
args), with an acceptance test pinning inspect == runtime.

Fixed the stale protocol.ts SandboxPermission comment: the network policy IS enforced on
Daytona; the local sidecar rejects a restricted-network run under strict; filesystem is
declared-only.

Docs synced (same PR): the agent-workflows documentation pages, the interface inventory and
its index, and services/agent/AGENTS.md.

Tests green: runner 160, SDK unit 940 + integration 4, service agent 34, FE playground 26 +
entity-ui 18.

Claude-Session: https://claude.ai/code/session_01GYo3UEfvsZpncagqb28Mbc
@vercel

vercel Bot commented Jun 24, 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 25, 2026 8:04am

Request Review

@dosubot dosubot Bot added the size:XL This PR changes 500-999 lines, ignoring generated files. label Jun 24, 2026
@coderabbitai

coderabbitai Bot commented Jun 24, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The PR renames Pi-family harness identifiers to pi_core and pi_agenta, removes the /run backend field, and routes agent execution through the sandbox-agent path. Related adapters, defaults, tests, and documentation were updated across the agent service, Python SDK, OSS service, and web consumers.

Changes

Sandbox-agent harness migration

Layer / File(s) Summary
Public harness contract and defaults
sdks/python/agenta/sdk/{utils/types.py,agents/{dtos.py,capabilities.py,utils/wire.py},engines/running/interfaces.py}, services/agent/src/{protocol.ts,version.ts}, docs/design/agent-workflows/{documentation/{agent-configuration.md,protocol.md},interfaces/{README.md,cross-service/{runner-to-harness.md,service-to-agent-runner.md},in-service/{backend-adapter.md,neutral-runtime-dtos.md},public-edge/{agent-config-schema.md,agent-messages.md,workflow-invoke.md}},projects/harness-rename/status.md}
Public harness ids, defaults, and /run request shapes move to pi_core and pi_agenta, and the contract docs now describe the harness-only selector.
Sandbox-agent dispatch and runtime path
services/agent/src/{cli.ts,server.ts,engines/sandbox_agent/run-plan.ts,tools/*.ts,AGENTS.md}, services/agent/tests/unit/{cli.test.ts,server.test.ts,sandbox-agent-run-plan.test.ts,tool-dispatch.test.ts,wire-contract.test.ts}, docs/design/agent-workflows/{documentation/{architecture.md,ground-truth.md,sessions.md,tools.md,ports-and-adapters.md},interfaces/in-service/runner-engine-internals.md}
The service runner now always dispatches through runSandboxAgent, and the runtime docs/tests drop the backend-selected Pi path.
SDK adapters and fake runner transport
sdks/python/agenta/sdk/agents/adapters/{harnesses.py,sandbox_agent.py}, sdks/python/oss/tests/pytest/integration/agents/{_fake_runner_backend.py,test_transport_roundtrip.py}, docs/design/agent-workflows/documentation/{adapters/{agenta.md,pi.md},skills.md}
The SDK adapter path and fake-runner backend now build /run payloads without an engine field and materialize the per-run Pi agent directory flow.
SDK contract and capability tests
sdks/python/oss/tests/pytest/unit/agents/{connections/*,golden/*,platform/*,skills/*,test_dtos_agent_config.py,test_dtos_capabilities_events.py,test_harness_adapters.py,test_wire_contract.py,test_skill_config_catalog.py}
SDK unit tests and fixtures now assert the renamed harness ids and updated /run payload shape.
OSS defaults and web consumers
services/oss/src/agent/{app.py,schemas.py}, services/oss/tests/pytest/unit/agent/*, web/{oss/src/components/AgentChatSlice/assets/transport.ts,packages/agenta-entity-ui/src/DrillInView/SchemaControls/connectionUtils.ts,packages/agenta-entity-ui/tests/unit/connectionUtils.test.ts,packages/agenta-playground/src/state/execution/agentRequest.ts,packages/agenta-playground/tests/unit/{agentMode.test.ts,agentRequest.test.ts}}
The OSS service defaults and web request builders now seed and assert pi_core.

Sequence Diagram(s)

sequenceDiagram
  participant serverTs as server.ts
  participant cliTs as cli.ts
  participant runSandboxAgent
  participant request_to_wire
  participant SandboxAgentBackend
  serverTs->>runSandboxAgent: POST /run request
  cliTs->>runSandboxAgent: CLI request
  runSandboxAgent->>request_to_wire: build harness-based payload
  request_to_wire-->>runSandboxAgent: /run JSON without backend
  runSandboxAgent->>SandboxAgentBackend: deliver request
  SandboxAgentBackend->>SandboxAgentBackend: stream subprocess run
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

  • Agenta-AI/agenta#4771: Updates the /run wire/request contract and Pi harness identifiers that this PR continues across the runner and docs.
  • Agenta-AI/agenta#4778: Touches runner engine dispatch around the legacy Pi path, which this PR removes in favor of sandbox-agent routing.
  • Agenta-AI/agenta#4786: Updates runner metadata and harness/engine identity surfaces that align with the constants changed here.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 16.67% which is insufficient. The required threshold is 60.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly matches the main change: removing the in-process backend and renaming harnesses.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description check ✅ Passed The description accurately matches the documented contract, rename, and cleanup changes in the PR.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch refactor/agent-harness-rename

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.

@dosubot dosubot Bot added python Pull requests that update Python code refactoring A code change that neither fixes a bug nor adds a feature labels Jun 24, 2026
@github-actions

github-actions Bot commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Railway Preview Environment

Status Destroyed (PR closed)

Updated at 2026-06-25T10:55:16.800Z

mmabrouk added a commit that referenced this pull request Jun 24, 2026
…t URI

Implements the contract-versioning POC slice (PR #4829): give the harness a
versioned slug + display name in the agent_config interface, and bind the live
agent handler to the builtin URI (architecture-followups issue 2). Builds on the
harness rename (#4833).

Harness slug+name (interface only): one SDK source `HARNESS_IDENTITIES`
(agents/dtos.py) maps each HarnessType to a versioned slug `agenta:harness:<value>:v0`
(the repo's slug grammar) + a display name. `AgentConfigSchema.harness` now emits both
a flat `enum` (back-compat) and a `oneOf` of `{const,title,x-ag-harness-slug}`; the FE
EnumSelectControl reads the oneOf for labels and writes the bare const. The stored/wire/
runtime harness value stays the bare string, so the /run wire, golden fixtures, and both
wire-contract tests are unchanged.

Issue 2 (bind the builtin URI): create_agent_app() registers the instrumented `_agent`
(auto_instrument BEFORE register, so tracing survives) and overrides the interface under
`agenta:builtin:agent:v0` via a new `register_interface` helper, so retrieve_handler /
retrieve_interface return the live handler and the same schemas /inspect advertises. Fixed
the stale agent CONFIGURATION_REGISTRY entry to the canonical `{"agent": build_agent_v0_default()}`.

Deferred per the POC spec: the /run `version` field, the if/elif version dispatch, and the
/health protocol skew read.

Tests: SDK 945 (+5 harness-identity), service agent 38 (+4 builtin-uri binding), wire
contract Python 20 + TS 160 unchanged, FE entity-ui 23 (+5 EnumSelectControl) + playground 26.

Claude-Session: https://claude.ai/code/session_01GYo3UEfvsZpncagqb28Mbc
@mmabrouk

Copy link
Copy Markdown
Member Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jun 24, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai coderabbitai 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.

Actionable comments posted: 3

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
sdks/python/oss/tests/pytest/unit/agents/test_wire_contract.py (1)

468-472: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Stale pi harness_options key — rename to pi_core.

This is the only remaining "pi" slice key in the renamed cohort. The assertion still passes (a Pi config renders no harnessFiles from its options regardless of the key), but leaving the old name in the contract-guard test means it silently stops representing the real pi_core slice.

🔧 Proposed fix
     config = PiAgentConfig(
         harness_options={
-            "pi": {"system": "You are Pi."},
+            "pi_core": {"system": "You are Pi."},
             "claude": {"permissions": {"default_mode": "plan"}},
         }
     )

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 47b423b2-9178-43bb-af93-1113b83b6914

📥 Commits

Reviewing files that changed from the base of the PR and between 8d40cff and 0e71bd0.

📒 Files selected for processing (69)
  • docs/design/agent-workflows/documentation/adapters/agenta.md
  • docs/design/agent-workflows/documentation/adapters/pi.md
  • docs/design/agent-workflows/documentation/agent-configuration.md
  • docs/design/agent-workflows/documentation/architecture.md
  • docs/design/agent-workflows/documentation/ground-truth.md
  • docs/design/agent-workflows/documentation/ports-and-adapters.md
  • docs/design/agent-workflows/documentation/protocol.md
  • docs/design/agent-workflows/documentation/sessions.md
  • docs/design/agent-workflows/documentation/skills.md
  • docs/design/agent-workflows/documentation/tools.md
  • docs/design/agent-workflows/interfaces/README.md
  • docs/design/agent-workflows/interfaces/cross-service/runner-to-harness.md
  • docs/design/agent-workflows/interfaces/cross-service/service-to-agent-runner.md
  • docs/design/agent-workflows/interfaces/in-service/backend-adapter.md
  • docs/design/agent-workflows/interfaces/in-service/neutral-runtime-dtos.md
  • docs/design/agent-workflows/interfaces/in-service/runner-engine-internals.md
  • docs/design/agent-workflows/interfaces/public-edge/agent-config-schema.md
  • docs/design/agent-workflows/interfaces/public-edge/agent-messages.md
  • docs/design/agent-workflows/interfaces/public-edge/workflow-invoke.md
  • docs/design/agent-workflows/projects/harness-rename/status.md
  • sdks/python/agenta/sdk/agents/adapters/harnesses.py
  • sdks/python/agenta/sdk/agents/adapters/sandbox_agent.py
  • sdks/python/agenta/sdk/agents/capabilities.py
  • sdks/python/agenta/sdk/agents/dtos.py
  • sdks/python/agenta/sdk/agents/utils/wire.py
  • sdks/python/agenta/sdk/engines/running/interfaces.py
  • sdks/python/agenta/sdk/utils/types.py
  • sdks/python/oss/tests/pytest/integration/agents/_fake_runner_backend.py
  • sdks/python/oss/tests/pytest/integration/agents/test_transport_roundtrip.py
  • sdks/python/oss/tests/pytest/unit/agents/connections/test_capabilities.py
  • sdks/python/oss/tests/pytest/unit/agents/connections/test_dtos_model_ref.py
  • sdks/python/oss/tests/pytest/unit/agents/connections/test_resolver.py
  • sdks/python/oss/tests/pytest/unit/agents/golden/run_request.claude.json
  • sdks/python/oss/tests/pytest/unit/agents/golden/run_request.pi_core.json
  • sdks/python/oss/tests/pytest/unit/agents/platform/test_connections_http.py
  • sdks/python/oss/tests/pytest/unit/agents/skills/test_skills_e2e.py
  • sdks/python/oss/tests/pytest/unit/agents/test_dtos_agent_config.py
  • sdks/python/oss/tests/pytest/unit/agents/test_dtos_capabilities_events.py
  • sdks/python/oss/tests/pytest/unit/agents/test_harness_adapters.py
  • sdks/python/oss/tests/pytest/unit/agents/test_wire_contract.py
  • sdks/python/oss/tests/pytest/unit/test_skill_config_catalog.py
  • services/agent/AGENTS.md
  • services/agent/src/cli.ts
  • services/agent/src/engines/pi.ts
  • services/agent/src/engines/sandbox_agent/run-plan.ts
  • services/agent/src/protocol.ts
  • services/agent/src/server.ts
  • services/agent/src/tools/callback.ts
  • services/agent/src/tools/dispatch.ts
  • services/agent/src/tools/mcp-bridge.ts
  • services/agent/src/version.ts
  • services/agent/tests/unit/cli.test.ts
  • services/agent/tests/unit/pi-capability-guard.test.ts
  • services/agent/tests/unit/pi-provider-env.test.ts
  • services/agent/tests/unit/sandbox-agent-run-plan.test.ts
  • services/agent/tests/unit/server.test.ts
  • services/agent/tests/unit/tool-dispatch.test.ts
  • services/agent/tests/unit/wire-contract.test.ts
  • services/oss/src/agent/app.py
  • services/oss/src/agent/schemas.py
  • services/oss/tests/pytest/unit/agent/test_default_agent_config.py
  • services/oss/tests/pytest/unit/agent/test_invoke_handler.py
  • services/oss/tests/pytest/unit/agent/test_select_backend.py
  • web/oss/src/components/AgentChatSlice/assets/transport.ts
  • web/packages/agenta-entity-ui/src/DrillInView/SchemaControls/connectionUtils.ts
  • web/packages/agenta-entity-ui/tests/unit/connectionUtils.test.ts
  • web/packages/agenta-playground/src/state/execution/agentRequest.ts
  • web/packages/agenta-playground/tests/unit/agentMode.test.ts
  • web/packages/agenta-playground/tests/unit/agentRequest.test.ts
💤 Files with no reviewable changes (6)
  • services/agent/tests/unit/pi-provider-env.test.ts
  • services/agent/tests/unit/pi-capability-guard.test.ts
  • sdks/python/oss/tests/pytest/unit/agents/skills/test_skills_e2e.py
  • services/agent/src/engines/pi.ts
  • sdks/python/oss/tests/pytest/unit/agents/golden/run_request.claude.json
  • sdks/python/oss/tests/pytest/unit/agents/connections/test_dtos_model_ref.py

Comment on lines +15 to +17
- **Harness:** which agent runs. Supported values are `pi_core`, `claude`, and experimental
`pi_agenta`. Default `pi_core`. `pi_core` and `pi_agenta` both drive the `pi` ACP agent;
`pi_agenta` is Pi with Agenta's forced opinion.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Clarify the pi_agenta description.

“Forced opinion” doesn’t match the contract wording elsewhere and is easy to misread. Use the actual forced skills/prompt/policy description instead.

📝 Suggested fix
-  `pi_agenta` is Pi with Agenta's forced opinion.
+  `pi_agenta` is Pi with Agenta's forced skills, prompt, and policy.
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- **Harness:** which agent runs. Supported values are `pi_core`, `claude`, and experimental
`pi_agenta`. Default `pi_core`. `pi_core` and `pi_agenta` both drive the `pi` ACP agent;
`pi_agenta` is Pi with Agenta's forced opinion.
- **Harness:** which agent runs. Supported values are `pi_core`, `claude`, and experimental
`pi_agenta`. Default `pi_core`. `pi_core` and `pi_agenta` both drive the `pi` ACP agent;
`pi_agenta` is Pi with Agenta's forced skills, prompt, and policy.

Comment on lines +40 to +41
The runner drives one engine, the sandbox-agent ACP path (`engines/sandbox_agent.ts`). The
`harness` field selects the agent; there is no engine selector on the wire.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Fix the stale engine-path reference.

engines/sandbox_agent.ts does not match the implementation path used in this stack, so this doc points readers at a dead or misleading location. Please update it to the canonical module path.

♻️ Suggested edit
- The runner drives one engine, the sandbox-agent ACP path (`engines/sandbox_agent.ts`).
+ The runner drives one engine, the sandbox-agent ACP path (`services/agent/src/engines/sandbox_agent/run-plan.ts`).
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
The runner drives one engine, the sandbox-agent ACP path (`engines/sandbox_agent.ts`). The
`harness` field selects the agent; there is no engine selector on the wire.
The runner drives one engine, the sandbox-agent ACP path (`services/agent/src/engines/sandbox_agent/run-plan.ts`). The
`harness` field selects the agent; there is no engine selector on the wire.

Comment thread services/agent/src/server.ts
@coderabbitai

coderabbitai Bot commented Jun 24, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

mmabrouk added a commit that referenced this pull request Jun 25, 2026
…t URI

Implements the contract-versioning POC slice (PR #4829): give the harness a
versioned slug + display name in the agent_config interface, and bind the live
agent handler to the builtin URI (architecture-followups issue 2). Builds on the
harness rename (#4833).

Harness slug+name (interface only): one SDK source `HARNESS_IDENTITIES`
(agents/dtos.py) maps each HarnessType to a versioned slug `agenta:harness:<value>:v0`
(the repo's slug grammar) + a display name. `AgentConfigSchema.harness` now emits both
a flat `enum` (back-compat) and a `oneOf` of `{const,title,x-ag-harness-slug}`; the FE
EnumSelectControl reads the oneOf for labels and writes the bare const. The stored/wire/
runtime harness value stays the bare string, so the /run wire, golden fixtures, and both
wire-contract tests are unchanged.

Issue 2 (bind the builtin URI): create_agent_app() registers the instrumented `_agent`
(auto_instrument BEFORE register, so tracing survives) and overrides the interface under
`agenta:builtin:agent:v0` via a new `register_interface` helper, so retrieve_handler /
retrieve_interface return the live handler and the same schemas /inspect advertises. Fixed
the stale agent CONFIGURATION_REGISTRY entry to the canonical `{"agent": build_agent_v0_default()}`.

Deferred per the POC spec: the /run `version` field, the if/elif version dispatch, and the
/health protocol skew read.

Tests: SDK 945 (+5 harness-identity), service agent 38 (+4 builtin-uri binding), wire
contract Python 20 + TS 160 unchanged, FE entity-ui 23 (+5 EnumSelectControl) + playground 26.

Claude-Session: https://claude.ai/code/session_01GYo3UEfvsZpncagqb28Mbc
@mmabrouk

Copy link
Copy Markdown
Member Author

Addressed CodeRabbit's one substantive finding (commit 3cb0a64c21):

  • Stale engines/pi.ts reference in skills.ts: the in-process Pi engine was removed in this PR, so the doc-comment's additionalSkillPaths bullet for it (and the "shared by both engines" header) were dead references. The comment now describes only the remaining sandbox-agent install path.

Skipped the two doc-wording nitpicks (architecture.md pi_agenta phrasing, ports-and-adapters.md engine-path) per the POC triage.

services/agent typecheck + skills/wire-contract tests green.

@mmabrouk mmabrouk left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

lgtm

@mmabrouk mmabrouk added lgtm This PR has been approved by a maintainer needs-review Agent updated; awaiting Mahmoud's review and removed needs-review Agent updated; awaiting Mahmoud's review labels Jun 25, 2026
@mmabrouk mmabrouk changed the base branch from chore/agent-remove-load-session to big-agents June 25, 2026 10:54
@mmabrouk mmabrouk merged commit ebf7d9b into big-agents Jun 25, 2026
53 of 56 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lgtm This PR has been approved by a maintainer python Pull requests that update Python code refactoring A code change that neither fixes a bug nor adds a feature size:XL This PR changes 500-999 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant