openclaw - ✅(Solved) Fix [Bug]: openclaw_gateway rejects Paperclip agent heartbeats — "unexpected property 'paperclip'" [2 pull requests, 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#74635Fetched 2026-04-30 06:21:50
View on GitHub
Comments
0
Participants
1
Timeline
5
Reactions
0
Participants
Timeline (top)
cross-referenced ×2labeled ×2referenced ×1

Version: OpenClaw 2026.4.26 (be8c246), Paperclip latest (rev 3494e84)

Paperclip now injects a paperclip property into the root of the agent invocation payload when invoking agents via the openclaw_gateway adapter. The gateway rejects it with:

invalid agent params: at root: unexpected property 'paperclip' AgentParamsSchema in protocol-Hjar_s3V.js has additionalProperties: false — any unknown field fails validation.

Temp workaround: Manually added paperclip: Type.Optional(Type.Unknown()) to AgentParamsSchema in the installed bundle.

Fix needed: Add paperclip: Type.Optional(Type.Unknown()) to AgentParamsSchema upstream, or switch to passing Paperclip run context via the existing extraSystemPrompt/inputProvenance fields.

Error Message

  1. Gateway rejects the connection — error in journalctl: Actual: Gateway rejects payload, agent stays in error status, task never executes

Root Cause

Version: OpenClaw 2026.4.26 (be8c246), Paperclip latest (rev 3494e84)

Paperclip now injects a paperclip property into the root of the agent invocation payload when invoking agents via the openclaw_gateway adapter. The gateway rejects it with:

invalid agent params: at root: unexpected property 'paperclip' AgentParamsSchema in protocol-Hjar_s3V.js has additionalProperties: false — any unknown field fails validation.

Temp workaround: Manually added paperclip: Type.Optional(Type.Unknown()) to AgentParamsSchema in the installed bundle.

Fix needed: Add paperclip: Type.Optional(Type.Unknown()) to AgentParamsSchema upstream, or switch to passing Paperclip run context via the existing extraSystemPrompt/inputProvenance fields.

Fix Action

Fix / Workaround

Temp workaround: Manually added paperclip: Type.Optional(Type.Unknown()) to AgentParamsSchema in the installed bundle.

PR fix notes

PR #10: fix(gateway): allow optional paperclip field in AgentParamsSchema

Description (problem / solution / changelog)

What and why

Paperclip now injects a paperclip property into the root of its agent invocation payload when calling the openclaw_gateway adapter. Because AgentParamsSchema has additionalProperties: false, the gateway rejected every Paperclip-triggered invocation with:

invalid agent params: at root: unexpected property 'paperclip'

Agents stayed in error status and tasks never executed.

Root cause

AgentParamsSchema in src/gateway/protocol/schema/agent.ts (line 74) does not include a paperclip property. Any field not listed in the schema is rejected by the AJV validator compiled at index.ts:265.

Fix

Add paperclip: Type.Optional(Type.Unknown()) to AgentParamsSchema. The field is optional and untyped - OpenClaw passes it through without inspecting it, similar to how attachments: Type.Optional(Type.Array(Type.Unknown())) already works for opaque attachment payloads.

Testing

  • Added validateAgentParams regression test: verifies a payload with paperclip: { runId: "...", workspaceId: "..." } is accepted (previously returned false, now returns true).
  • Added complementary test: confirms truly unknown fields still fail, so the additionalProperties: false guard is still enforced for everything else.

Fixes #74635


Generated by Claude Code

<!-- devin-review-badge-begin -->
<a href="https://app.devin.ai/review/suboss87/openclaw/pull/10" target="_blank"> <picture> <source media="(prefers-color-scheme: dark)" srcset="https://static.devin.ai/assets/gh-open-in-devin-review-dark.svg?v=1"> <img src="https://static.devin.ai/assets/gh-open-in-devin-review-light.svg?v=1" alt="Open in Devin Review"> </picture> </a> <!-- devin-review-badge-end -->

Changed files

  • src/gateway/protocol/index.test.ts (modified, +23/-1)
  • src/gateway/protocol/schema/agent.ts (modified, +1/-0)

PR #12: fix(gateway): allow Paperclip integration metadata through AgentParams validator

Description (problem / solution / changelog)

Closes openclaw/openclaw#74635

Problem

The AJV-compiled validateAgentParams validator is compiled with additionalProperties: false from AgentParamsSchema. Any gateway RPC call that includes a paperclip field (Paperclip integration metadata attached by the iOS/macOS app) is rejected with a validation error before reaching the agent runner.

Root cause

AgentParamsSchema in src/gateway/protocol/schema/agent.ts had no paperclip property. The TypeBox schema uses additionalProperties: false, so AJV rejects any unknown top-level property including paperclip.

Fix

Added paperclip: Type.Optional(Type.Unknown()) to AgentParamsSchema. Using Type.Unknown() keeps it maximally permissive -- Paperclip metadata is opaque to the gateway and only consumed downstream by Paperclip-aware agents.

Tests

Added two regression tests to src/gateway/protocol/index.test.ts:

  • accepts agentParams with paperclip metadata -- verifies validateAgentParams({ ..., paperclip: { source: "paperclip", attachmentId: "abc" } }) returns true
  • rejects agentParams with an unrecognized unknown field -- verifies validateAgentParams({ ..., unknownField: true }) still returns false (strict mode preserved)

Generated by Claude Code

<!-- devin-review-badge-begin -->
<a href="https://app.devin.ai/review/suboss87/openclaw/pull/12" target="_blank"> <picture> <source media="(prefers-color-scheme: dark)" srcset="https://static.devin.ai/assets/gh-open-in-devin-review-dark.svg?v=1"> <img src="https://static.devin.ai/assets/gh-open-in-devin-review-light.svg?v=1" alt="Open in Devin Review"> </picture> </a> <!-- devin-review-badge-end -->

Changed files

  • src/gateway/protocol/index.test.ts (modified, +23/-1)
  • src/gateway/protocol/schema/agent.ts (modified, +1/-0)
RAW_BUFFERClick to expand / collapse

Bug type

Behavior bug (incorrect output/state without crash)

Beta release blocker

No

Summary

Version: OpenClaw 2026.4.26 (be8c246), Paperclip latest (rev 3494e84)

Paperclip now injects a paperclip property into the root of the agent invocation payload when invoking agents via the openclaw_gateway adapter. The gateway rejects it with:

invalid agent params: at root: unexpected property 'paperclip' AgentParamsSchema in protocol-Hjar_s3V.js has additionalProperties: false — any unknown field fails validation.

Temp workaround: Manually added paperclip: Type.Optional(Type.Unknown()) to AgentParamsSchema in the installed bundle.

Fix needed: Add paperclip: Type.Optional(Type.Unknown()) to AgentParamsSchema upstream, or switch to passing Paperclip run context via the existing extraSystemPrompt/inputProvenance fields.

Steps to reproduce

Self-host Paperclip (latest) — ghcr.io/paperclipai/paperclip:latest 2. Register an agent with adapterType: openclaw_gateway, pointing to an OpenClaw 2026.4.26 gateway 3. Approve the device pairing in OpenClaw 4. Assign a task to the agent in Paperclip so it triggers an invocation 5. Gateway rejects the connection — error in journalctl:

[ws] ⇄ res ✗ agent 0ms errorCode=INVALID_REQUEST errorMessage=invalid agent params: at root: unexpected property 'paperclip'

Expected behavior

Expected: Agent receives the task and processes it

Actual behavior

Actual: Gateway rejects payload, agent stays in error status, task never executes

OpenClaw version

2026.4.26 (be8c246)

Operating system

Docker

Install method

docker

Model

Claude Sonnet 4.6

Provider / routing chain

paperclip --> openclaw gateway

Additional provider/model setup details

No response

Logs, screenshots, and evidence

Impact and severity

No response

Additional information

No response

extent analysis

TL;DR

Add paperclip: Type.Optional(Type.Unknown()) to AgentParamsSchema in the upstream code or modify the Paperclip invocation to use existing fields like extraSystemPrompt or inputProvenance.

Guidance

  • The error occurs because the AgentParamsSchema does not expect a paperclip property, which is now injected by Paperclip.
  • To fix this, you can either update the AgentParamsSchema to include the paperclip property as optional or change how Paperclip passes its context.
  • Consider the temporary workaround of manually adding paperclip: Type.Optional(Type.Unknown()) to AgentParamsSchema in your local installation as a proof of concept before applying a permanent fix.
  • Evaluate the feasibility of using extraSystemPrompt or inputProvenance fields as an alternative to passing Paperclip context, which might avoid schema changes.

Example

No specific code example is provided due to the lack of detailed implementation context, but the fix involves updating the schema or modifying the invocation payload.

Notes

The solution requires either updating the schema to accommodate the new paperclip property or adjusting how Paperclip integrates with the OpenClaw gateway to avoid schema violations. The choice between these approaches depends on the specific requirements and constraints of the system.

Recommendation

Apply the workaround by adding paperclip: Type.Optional(Type.Unknown()) to AgentParamsSchema until a permanent fix can be implemented upstream, as it provides a quick resolution to the immediate 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…

FAQ

Expected behavior

Expected: Agent receives the task and processes it

Still need to ship something?

×6

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

Back to top recommendations

TRENDING