Skip to content

Built-in 'local' runtime: run agents as plain processes, no container engine #38

Closed

Description

@melvincarvalho

jsclaw inherits nanoclaw's container-per-agent premise, but Docker is a runtime choice, not a requirement — Claude Code and agent-micro both run fine as plain processes. Today the only way to go containerless is an external shim script posing as the docker binary (proven working: a gateway has been running this way against agent-micro since 2026-06-11).

Proposal

A first-class containerRuntime: "local" (or "process") mode:

  • runContainerAgent() spawns the agent runner directly as a child process instead of docker run
  • The -v mount mapping becomes env vars: workspace dir → JSCLAW_WORKSPACE, IPC dir → JSCLAW_IPC_BASE (agent-micro already reads these; the default runner would need the same)
  • Same stdin/stdout ContainerInput/ContainerOutput contract, same _close sentinel lifecycle
  • Process tracking replaces ps/rm -f orphan reaping (pidfiles or in-memory registry)
  • New config key for the runner entrypoint, e.g. localRunner: "/path/to/runner.js"

Security framing (important)

Local mode is no isolation — the agent runs as the host user with access to everything, not just its agents/<id>/ folder. Docs must say this plainly: Docker/Podman stays the default and the recommendation for autonomous (heartbeat/scheduled) agents; local mode is for trusted workloads, development, and machines without a container engine.

Reference

The working shim this replaces translates docker run -i --rm --name X -e K=V -v host:container image into env vars + exec node runner.js, and implements stop/kill/rm -f/ps via pidfiles — useful as a spec for what the built-in mode must cover.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions