openclaw - 💡(How to fix) Fix sessions_spawn with runtime='acp' fails: spawnedBy is only supported for subagent:* sessions [2 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#43663Fetched 2026-04-08 00:16:10
View on GitHub
Comments
2
Participants
2
Timeline
4
Reactions
0
Timeline (top)
commented ×2closed ×1locked ×1

sessions_spawn with runtime: "acp" fails with:

spawnedBy is only supported for subagent:* sessions

The ACP backend is configured and healthy (logs confirm acpx runtime backend ready), but the tool's internal session creation path tries to set spawnedBy on an acp:* session key, which the gateway rejects.

Error Message

  1. Error returned: spawnedBy is only supported for subagent:* sessions Also fails without agentId (relying on acp.defaultAgent). Same error.

Root Cause

sessions_spawn with runtime: "acp" fails with:

spawnedBy is only supported for subagent:* sessions

The ACP backend is configured and healthy (logs confirm acpx runtime backend ready), but the tool's internal session creation path tries to set spawnedBy on an acp:* session key, which the gateway rejects.

Fix Action

Fix / Workaround

{
  "acp": {
    "enabled": true,
    "backend": "acpx",
    "defaultAgent": "gemini",
    "allowedAgents": ["gemini", "claude", "codex", "opencode", "pi", "kimi"],
    "dispatch": { "enabled": true }
  },
  "plugins": {
    "entries": {
      "acpx": {
        "enabled": true,
        "config": {
          "permissionMode": "approve-all",
          "nonInteractivePermissions": "deny"
        }
      }
    }
  }
}
⇄ res ✗ sessions.patch 5ms errorCode=INVALID_REQUEST errorMessage=spawnedBy is only supported for subagent:* sessions

Code Example

spawnedBy is only supported for subagent:* sessions

---

{
  "acp": {
    "enabled": true,
    "backend": "acpx",
    "defaultAgent": "gemini",
    "allowedAgents": ["gemini", "claude", "codex", "opencode", "pi", "kimi"],
    "dispatch": { "enabled": true }
  },
  "plugins": {
    "entries": {
      "acpx": {
        "enabled": true,
        "config": {
          "permissionMode": "approve-all",
          "nonInteractivePermissions": "deny"
        }
      }
    }
  }
}

---

sessions_spawn({ runtime: "acp", agentId: "gemini", task: "...", label: "test" })

---

⇄ res ✗ sessions.patch 5ms errorCode=INVALID_REQUEST errorMessage=spawnedBy is only supported for subagent:* sessions
RAW_BUFFERClick to expand / collapse

Environment

  • OpenClaw version: 2026.3.8 (3caab92)
  • OS: Linux 6.12.62+rpt-rpi-2712 (arm64, Raspberry Pi)
  • Node: v22.22.0
  • acpx plugin: 0.1.15 (plugin-local binary, healthy)

Description

sessions_spawn with runtime: "acp" fails with:

spawnedBy is only supported for subagent:* sessions

The ACP backend is configured and healthy (logs confirm acpx runtime backend ready), but the tool's internal session creation path tries to set spawnedBy on an acp:* session key, which the gateway rejects.

Config

{
  "acp": {
    "enabled": true,
    "backend": "acpx",
    "defaultAgent": "gemini",
    "allowedAgents": ["gemini", "claude", "codex", "opencode", "pi", "kimi"],
    "dispatch": { "enabled": true }
  },
  "plugins": {
    "entries": {
      "acpx": {
        "enabled": true,
        "config": {
          "permissionMode": "approve-all",
          "nonInteractivePermissions": "deny"
        }
      }
    }
  }
}

Steps to reproduce

  1. Configure ACP with acpx backend (as above)
  2. Restart gateway
  3. Confirm acpx runtime backend ready in logs
  4. From main agent session, call:
    sessions_spawn({ runtime: "acp", agentId: "gemini", task: "...", label: "test" })
  5. Error returned: spawnedBy is only supported for subagent:* sessions

Also fails without agentId (relying on acp.defaultAgent). Same error.

Gateway log

⇄ res ✗ sessions.patch 5ms errorCode=INVALID_REQUEST errorMessage=spawnedBy is only supported for subagent:* sessions

Expected behavior

sessions_spawn with runtime: "acp" should create an agent:<agentId>:acp:<uuid> session and route to the acpx backend without going through the subagent spawnedBy path.

extent analysis

Fix Plan

To resolve the issue, we need to modify the sessions_spawn function to handle acp runtime sessions without setting spawnedBy. Here are the steps:

  • Modify the sessions_spawn function to check if the runtime is acp and handle it separately.
  • Create a new session key in the format agent:<agentId>:acp:<uuid> and route it to the acpx backend.

Example Code

// Modified sessions_spawn function
function sessions_spawn(options) {
  if (options.runtime === 'acp') {
    // Create a new session key
    const sessionKey = `agent:${options.agentId || 'gemini'}:acp:${uuidv4()}`;
    // Route the session to the acpx backend
    return acpxBackend.createSession(sessionKey, options.task, options.label);
  } else {
    // Handle other runtimes as before
    // ...
  }
}

// acpxBackend.createSession function
function createSession(sessionKey, task, label) {
  // Create a new session in the acpx backend
  // ...
  return {
    sessionKey,
    task,
    label,
  };
}

Verification

To verify that the fix worked, follow these steps:

  • Restart the gateway
  • Call sessions_spawn with runtime: "acp" and verify that a new session is created in the acpx backend
  • Check the gateway logs to ensure that the spawnedBy error is no longer present

Extra Tips

  • Make sure to update the acpx plugin to the latest version to ensure compatibility with the modified sessions_spawn function.
  • Test the modified sessions_spawn function with different agentId and runtime options to ensure that it handles all scenarios correctly.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

FAQ

Expected behavior

sessions_spawn with runtime: "acp" should create an agent:<agentId>:acp:<uuid> session and route to the acpx backend without going through the subagent spawnedBy path.

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

openclaw - 💡(How to fix) Fix sessions_spawn with runtime='acp' fails: spawnedBy is only supported for subagent:* sessions [2 comments, 2 participants]