openclaw - 💡(How to fix) Fix ACP SDK: Missing default values for optional array parameters cause Claude tool schema validation to fail [1 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#69849Fetched 2026-04-22 07:47:29
View on GitHub
Comments
0
Participants
1
Timeline
1
Reactions
0
Participants
Timeline (top)
cross-referenced ×1

Error Message

When using Claude (via API Pro or other providers) with OpenClaw's ACP SDK, the agent registration fails with the following error:

  • ❌ Claude models: Fail with Invalid schema error until fixed
  • Error occurs when agent registers tools with Claude

Root Cause

Claude has stricter JSON Schema validation than OpenAI/GPT. When the ACP SDK defines optional array parameters without a default value, Claude receives for those fields, which violates its schema requirements.

Fix Action

Fix

Add to all optional array parameters:

Example:

Workaround

Manually patch in the installed package until this is fixed upstream.

RAW_BUFFERClick to expand / collapse

Bug Description

When using Claude (via API Pro or other providers) with OpenClaw's ACP SDK, the agent registration fails with the following error:

Root Cause

Claude has stricter JSON Schema validation than OpenAI/GPT. When the ACP SDK defines optional array parameters without a default value, Claude receives for those fields, which violates its schema requirements.

Affected Schemas

The following Zod schemas in have optional array parameters without defaults:

SchemaField
, OPENCLAW_SERVICE_KIND=gateway
NODE_NO_WARNINGS=1
PWD=/root/.openclaw/workspace
LOGNAME=root
SYSTEMD_EXEC_PID=1782252
OPENCLAW_SHELL=exec
HOME=/root
LANG=en_US.UTF-8
TMPDIR=/tmp
INVOCATION_ID=3f3d552fb5e141b5a8f6eecce73c6e23
MANAGERPID=572443
OPENCLAW_GATEWAY_PORT=18789
USER=root
OPENCLAW_SYSTEMD_UNIT=openclaw-gateway.service
SHLVL=0
OPENCLAW_SERVICE_MARKER=openclaw
OPENCLAW_PATH_BOOTSTRAPPED=1
OPENCLAW_WINDOWS_TASK_NAME=OpenClaw Gateway
XDG_RUNTIME_DIR=/run/user/0
OPENCLAW_CLI=1
OPENCLAW_SERVICE_VERSION=2026.4.10
JOURNAL_STREAM=8:1217380884
PATH=/root/.bun/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/root/.local/bin:/root/.npm-global/bin:/root/bin:/root/.volta/bin:/root/.asdf/shims:/root/.nvm/current/bin:/root/.fnm/current/bin:/root/.local/share/pnpm
DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/0/bus
_=/usr/bin/env
,
,
,

Fix

Add to all optional array parameters:

Example:

Impact

  • ✅ GPT/OpenAI models: Already work (lenient schema validation)
  • ❌ Claude models: Fail with Invalid schema error until fixed

Environment

  • OpenClaw version: 2026.4.15
  • Provider: API Pro (Claude Opus 4.7)
  • Error occurs when agent registers tools with Claude

Workaround

Manually patch in the installed package until this is fixed upstream.

extent analysis

TL;DR

Add default values to optional array parameters in the affected Zod schemas to fix the agent registration issue with Claude.

Guidance

  • Identify the affected Zod schemas in the OpenClaw ACP SDK and add default values to optional array parameters.
  • Verify that the fix works by attempting to register an agent with Claude after making the changes.
  • Consider manually patching the installed package as a temporary workaround until the fix is available upstream.
  • Review the OpenClaw version and provider configuration to ensure compatibility with the fix.

Example

// Example of adding a default value to an optional array parameter
const mySchema = z.array(z.string()).default([]);

Notes

The fix may not be applicable to all versions of OpenClaw or providers, and it's essential to review the specific configuration and version being used.

Recommendation

Apply the workaround by manually patching the installed package until the fix is available upstream, as this will allow for immediate resolution of the issue.

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…

Still need to ship something?

×6

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

Back to top recommendations

TRENDING