Skip to content

fix(protocol): allow paperclip field in AgentParamsSchema#75023

Closed
Linux2010 wants to merge 1 commit into
openclaw:mainfrom
Linux2010:fix/issue-74635-paperclip-agent-params
Closed

fix(protocol): allow paperclip field in AgentParamsSchema#75023
Linux2010 wants to merge 1 commit into
openclaw:mainfrom
Linux2010:fix/issue-74635-paperclip-agent-params

Conversation

@Linux2010

Copy link
Copy Markdown
Contributor

Summary

Paperclip agent injects a paperclip property into agent invocation payloads when using the openclaw_gateway adapter, but the gateway validation rejects it with:

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

AgentParamsSchema has additionalProperties: false, so any unknown field fails validation.

Fix

Add paperclip: Type.Optional(Type.Unknown()) to AgentParamsSchema to allow Paperclip and other third-party integrations to pass runtime context without breaking gateway validation. The gateway accepts but ignores this field.

Test Plan

  • Schema modification compiles without TypeScript errors
  • Gateway accepts agent requests with paperclip field
  • Paperclip agent can successfully invoke OpenClaw gateway

Fixes #74635

Paperclip agent injects a 'paperclip' property into agent invocation
payloads, but gateway validation rejects unknown fields due to
additionalProperties: false. Add optional paperclip field to allow
third-party integrations without breaking validation.

Fixes openclaw#74635
@openclaw-barnacle openclaw-barnacle Bot added app: web-ui App: web-ui gateway Gateway runtime size: XS labels Apr 30, 2026
@clawsweeper

clawsweeper Bot commented Apr 30, 2026

Copy link
Copy Markdown
Contributor

Thanks for the context here. I swept through the related work, and this is now duplicate or superseded.

Close as duplicate/superseded. The Paperclip root-field rejection is still real on current main, but this PR is a later, narrower duplicate of older open PRs that already cover the same compatibility fix with tests and maintainer-review context.

So I’m closing this here and keeping the remaining discussion on the canonical linked item.

Review details

Best possible solution:

Close this duplicate PR and consolidate review on one canonical implementation, preferably an additive adapter metadata contract or an explicitly approved Paperclip compatibility field with tests, generated protocol artifacts, and follow-up closure of duplicate reports after merge.

Do we have a high-confidence way to reproduce the issue?

Yes. Sending a Gateway agent request with a root-level paperclip field against current main follows a deterministic validation path: AgentParamsSchema has no such field, the object is closed, and the handler rejects before dispatch.

Is this the best way to solve the issue?

No. This PR fixes the immediate validation failure in principle, but it is not the best current path because older open PRs already cover the same work with tests and maintainer context, and this branch leaves protocol tests/generated artifacts out of sync.

Security review:

Security review cleared: The diff only adds an optional ignored schema field and does not touch workflows, dependencies, lockfiles, scripts, secrets, or package publishing surfaces.

What I checked:

Likely related people:

  • vincentkoc: Recent history on the central Gateway protocol/agent paths includes input-provenance schema sharing and spawned workspace/agent-param boundary work, which are adjacent to the strict AgentParamsSchema validation surface. (role: recent gateway protocol and agent-param boundary maintainer; confidence: high; commits: 7c889e71136a, 46a332385d11, 985000026e35; files: src/gateway/protocol/schema/agent.ts, src/gateway/protocol/index.ts, src/gateway/server-methods/agent.ts)
  • steipete: Recent commits and merges touch Gateway protocol generated models and the Gateway agent handler, and related PR discussion routes maintainer review for this surface to steipete alongside vincentkoc. (role: recent adjacent Gateway/protocol maintainer; confidence: medium; commits: bdba90a20b2b, e035300d8ed3, ac0fa474f831; files: apps/shared/OpenClawKit/Sources/OpenClawProtocol/GatewayModels.swift, apps/macos/Sources/OpenClawProtocol/GatewayModels.swift, src/gateway/server-methods/agent.ts)

Codex review notes: model gpt-5.5, reasoning high; reviewed against 9cb71f767242.

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

Labels

app: web-ui App: web-ui gateway Gateway runtime size: XS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: openclaw_gateway rejects Paperclip agent heartbeats — "unexpected property 'paperclip'"

1 participant