Skip to content

Introduce AgentRuntime interface with DockerRuntime adapter (no behaviour change) #3758

Done

Description

@integry

Agent execution is hard-wired to the docker CLI: each provider builds a raw docker run --rm -i argv (packages/core/src/agents/impl/utils/dockerArgsBuilder.ts, codexDockerArgsBuilder.ts, antigravityDockerArgsBuilder.ts, OpenCode/Vibe builders), packages/core/src/claude/docker/dockerExecutor.ts spawns docker, and admission, cost cap (dockerCostCap.ts), log handling, liveness (docker ps) and stop (docker inspect/stop) key on command === 'docker' && args[0] === 'run'. About 34 non-test files reference 'docker'.

Introduce a runtime seam so Docker becomes one implementation and other runtimes (Sprites, Fly Machines, Podman, remote Docker host) plug in.

Acceptance:

  • A structured AgentRunSpec (image/runtime profile, entrypoint+args, env, workspace, credential mounts, resources: memory/cpus/pids, network mode, MCP grant, labels) produced by every provider instead of argv.
  • AgentRuntime interface: start(spec) -> handle with stdout/stderr streams, wait(), stop(signal, timeout), inspect()/isAlive(), plus capability flags (supportsBindMounts, supportsRestrictedNetwork, supportsMcpPrivateNetwork, reattach).
  • DockerRuntime renders the spec to the exact argv used today (golden tests comparing old vs new argv per provider).
  • Admission, cost cap, liveness, stop and log gates use the handle/spec, not argv string matching.
  • Runtime selected per agent config / env (PROPR_AGENT_RUNTIME=docker default).
  • All existing tests pass; no behaviour change for current installs.

Implementation

Add packages/core/src/agents/runtime/{types.ts,dockerRuntime.ts,registry.ts}. Convert each provider arg builder to return AgentRunSpec and move argv rendering (including agentContainerResources.ts flags --init/--memory/--memory-swap/--cpus/--pids-limit, agentContainerNetwork.ts network selection, agentGitAccess.ts env, egress socket mount) into DockerRuntime. Replace direct executeDockerCommand callers with runtime.start(). Keep a golden-argv test per provider to prove parity. Update docs/docs/architecture/coding-agent-integration.md and agent-runtime.md to describe the seam.

Activity

  1. propr-dev commented on Nov 24, 2026

    @propr-dev
    Contributor

    🤖 AI processing has started for this issue using claude agent with claude-opus-5-5 model.

    I'll analyze the problem and work on a solution. This may take a few minutes.

    Processing Details:

    • Agent: claude
    • Model: claude-opus-5-5
    • Branch: 3758/claude-opus-5-5-introduce-agentruntime-in-20261124-0015-hel
    • Base Branch: 3758-epic-runtime-abstraction-sc0
    • Worktree: issue-3758-20261124-0015-claude-opus-5-5-hel

    🔍 Track Task Execution

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions