Repository navigation
fix(a2a): bound outbound JSON response bodies - #132273
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 30, 2026, 3:20 AM ET / 07:20 UTC. ClawSweeper reviewWhat this changesThe PR routes outbound A2A peer JSON replies through OpenClaw’s bounded Plugin SDK response reader and adds regression coverage for oversized and credential-reflecting malformed replies. Regression provenancePossible regression — probable (reproduction; reviewed change). No predecessor PR is attributed. Merge readinessThe PR remains necessary: current main still parses successful A2A peer replies with unbounded Priority: P2 Review scores
Verification
How this fits togetherA2A outbound delivery sends a JSON-RPC request to a configured peer and parses the successful peer reply before returning a delivery receipt to the channel layer. The shared Plugin SDK response reader is the boundary that limits peer-controlled bodies and prevents request credentials from surviving parser errors. flowchart LR
A[Outgoing A2A message] --> B[Outbound A2A delivery]
B --> C[Protected peer request]
C --> D[Peer HTTP response]
D --> E[Bounded shared JSON reader]
E --> F[A2A response validation]
F --> G[Delivery receipt]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +5, Tests +47. Total +52 across 2 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Land the direct reuse of the existing Plugin SDK response-reader contract so every successful outbound A2A peer reply is bounded and parser failures cannot retain active outbound credentials. Do we have a high-confidence way to reproduce the issue? Yes. The supplied real loopback A2A run exercises the production sender before and after the change, and current main source still uses the unbounded parse path. Is this the best way to solve the issue? Yes. Reusing the existing public bounded reader at the peer-response owner fixes both body growth and parser-cause retention without changing A2A request, schema-validation, or retry policy. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 41dccabf1796. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
History |
|
Maintainer gate review:
|
|
Thanks @RileyJJY! Proof: A real loopback A2A peer returned the same normal and oversized valid JSON replies to the production send path. The 1,048,653-byte reply still succeeded, while the 17,825,873-byte reply now stopped at OpenClaw's shared 16,777,216-byte limit. A malformed reply that reflected the outbound credential retained neither the credential nor a parser cause.
Example
|
Route successful A2A peer JSON through OpenClaw's shared bounded response reader. This rejects oversized peer responses at the existing 16 MiB limit and prevents malformed reflected data from retaining active outbound credentials. Normal replies, schema validation, and the one-time legacy method retry remain unchanged. Co-authored-by: Ayaan Zaidi <[email protected]>
What Problem This Solves
An A2A peer controls its successful HTTP response body. The outbound channel parsed that body with
Response.json(), so it could buffer and accept JSON larger than OpenClaw's shared 16 MiB response limit.Root cause
sendA2aChannelTextused the Server-Side Request Forgery guard for the request, but bypassed OpenClaw's bounded reader when it consumed the successful response.Fix
readProviderJsonResponsehelper.Evidence
The same production send path called a real loopback A2A peer at both revisions.
aace96c6720e9592e1cd6fddnormal-control-tasknormal-control-taskoversized-boundary-taskThe peer recorded
SendMessagefor every probe, which proves the real A2A request reached the loopback server.Tests
extensions/a2a/src/outbound.test.ts: 8 passed.AI-assisted: built with Codex.