#regular agenst and acp agents

1 messages · Page 1 of 1 (latest)

zinc lotus
#

Can you help me understand regular default agent setup and create config for acp agent that spawns claude code harness to do work for specific projects.
I got this config for my main agent:

"agents": {
    "defaults": {
      "model": {
        "primary": "opencode/kimi-k2.5",
        "fallbacks": [
          "openai-codex/gpt-5.4",
          "github-copilot/gpt-5.4",
...

and this was added as a acp agent definition in config :

 "agents": {
    "list": [
      {
        "id": "claude",
        "runtime": {
          "type": "acp",
          "acp": {
            "agent": "claude",
            "backend": "acpx",
            "mode": "persistent",
            "cwd": "/home/clawdbot/clawd"
          }
        }
      }
    ]
  },

how should my config be set up correctly to have main agent and add acp functionality for it?

spare egretBOT
#

To help others find answers, you can mark your question as solved via Right click solution message -> Apps -> âś… Mark Solution

cedar roverBOT
#

Two separate things are getting mixed together here:

  1. Regular “OpenClaw agent” model defaults (agents.defaults.model) → controls which LLM provider/model OpenClaw uses for normal chat/tool-calling turns.

  2. ACP runtime (agents.list[].runtime.type="acp") → controls which external harness (Claude Code/Codex/OpenCode/…) is used when a session is routed to ACP. Your agents.defaults.model does not “power” Claude Code; Claude Code is its own harness runtime.

Also: you can’t have two "agents": { ... } blocks in the same config object — the latter one wins. You need one agents object that contains both defaults and list.


Minimal “main agent + a Claude Code ACP agent” config

{
  // 1) Enable ACP globally + allow the harness ids you want
  acp: {
#
    enabled: true,
    backend: "acpx",
    allowedAgents: ["claude", "codex", "opencode", "gemini", "kimi", "pi"],
  },

  // 2) Enable the acpx plugin backend (required for backend: "acpx")
  plugins: {
    entries: {
      acpx: {
        enabled: true,
        config: {
          // IMPORTANT for non-interactive harness runs:
          // otherwise writes/exec can fail with “Permission prompt unavailable…”
          permissionMode: "approve-all",
          nonInteractivePermissions: "fail",
#
        },
      },
    },
  },

  // 3) One combined agents block
  agents: {
    defaults: {
      model: {
        primary: "opencode/kimi-k2.5",
        fallbacks: ["openai-codex/gpt-5.4", "github-copilot/gpt-5.4"],
      },
    },

    list: [
#
      {
        id: "main",
        default: true,
        // (optional) workspace, tools, sandbox, etc…
      },

      {
        id: "claude",
        name: "Claude Code",
        runtime: {
          type: "acp",
          acp: {
            agent: "claude",     // harness id (acpx alias)
            backend: "acpx",
            mode: "persistent",
#
            cwd: "/home/clawdbot/projects/some-repo", // default working dir
          },
        },
      },
    ],
  },

  // 4) Decide routing: which conversations go to which OpenClaw agent
  bindings: [
    { type: "route", agentId: "main", match: { channel: "discord", accountId: "default" } },

    // Optional: route a specific channel/thread to the Claude ACP agent:
    // { type: "route", agentId: "claude", match: { channel: "discord", accountId: "default", peer: { kind: "channel", id: "123..." } } },
  ],
}
#

Docs:


“Claude Code for specific projects” (best practice)

If “specific projects” = different repos, you usually don’t want one global cwd. You have two good options:

Option A: multiple Claude ACP agents (one per project)

Make claude-repoA, claude-repoB, each with different runtime.acp.cwd, then route specific channels to each.

Option B: keep one agent, but bind specific channels to ACP with per-channel cwd

Use bindings[] with type: "acp" (persistent ACP binding) and set acp.cwd per channel/thread/topic. (This is exactly what the ACP docs recommend for non-ephemeral workflows.)


#

If you tell me which workflow you want:

  1. “I want a dedicated Discord channel per repo that always uses Claude Code” vs
  2. “I mostly chat normally, but sometimes I spin up Claude Code in a thread”

…I can suggest the cleanest bindings[] layout for it.

Also: what openclaw --version are you on? (ACP config has evolved a bit across versions.)

zinc lotus
#

which layer should the global acp configuration be? root level in config?

cedar roverBOT
#

Yes — the global ACP policy/config lives at the root level of your config, as a top-level sibling of agents, channels, bindings, etc.

Think of it as 3 layers (highest → lowest precedence):

  1. Global ACP policy (root): acp: { enabled, backend, allowedAgents, … }
  2. Per-OpenClaw-agent ACP defaults: agents.list[].runtime.type="acp" + agents.list[].runtime.acp.{agent,backend,mode,cwd}
  3. Per-conversation overrides/bindings: bindings[] entries with type:"acp" and bindings[].acp.{cwd,label,mode,backend}

Minimal shape:

{
  acp: {
    enabled: true,
    backend: "acpx",
    allowedAgents: ["claude", "codex", "opencode", "gemini", "kimi", "pi"],