fix(clickclack): bound REST success JSON response reads#96970
Conversation
|
Codex review: needs maintainer review before merge. Reviewed June 27, 2026, 10:24 AM ET / 14:24 UTC. Summary PR surface: Source +3, Tests +94. Total +97 across 2 files. Reproducibility: yes. Current main clearly routes ClickClack REST success responses through raw Review metrics: 1 noteworthy metric.
Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Risk before merge
Maintainer options:
Next step before merge
Security Review detailsBest possible solution: Land the shared bounded-reader helper change once maintainers accept the 16 MiB success-response cap for ClickClack REST responses and the current green checks remain tied to the latest head. Do we have a high-confidence way to reproduce the issue? Yes. Current main clearly routes ClickClack REST success responses through raw Is this the best way to solve the issue? Yes. The best implementation point is the single ClickClack AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 9d800b71c060. Label changesLabel changes:
Label justifications:
Evidence reviewedPR surface: Source +3, Tests +94. Total +97 across 2 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
|
4a89e2c to
638a780
Compare
638a780 to
78f9be6
Compare
78f9be6 to
163d01d
Compare
|
Maintainer review and merge prep done. Evidence:
Maintainer decision accepted: ClickClack REST success JSON over the shared 16 MiB provider cap now fails early and cancels the response stream. Error response limiting, auth/header setup, request URLs, target/gateway callers, and payload unwrapping are unchanged. Known proof gap: no credential-backed live ClickClack API call was run; this PR changes the response-body reader boundary, which is covered by loopback streamed response tests. |
|
Merged via squash.
|
* fix(clickclack): bound REST success JSON response reads * test(clickclack): harden response cap proof --------- Co-authored-by: Vincent Koc <[email protected]>
|
🦞🧹 Reason: re-review requires an open issue or PR. |
* fix(clickclack): bound REST success JSON response reads * test(clickclack): harden response cap proof --------- Co-authored-by: Vincent Koc <[email protected]>
* fix(clickclack): bound REST success JSON response reads * test(clickclack): harden response cap proof --------- Co-authored-by: Vincent Koc <[email protected]>
* fix(clickclack): bound REST success JSON response reads * test(clickclack): harden response cap proof --------- Co-authored-by: Vincent Koc <[email protected]>
Origin / follow-up
Follow-up to #96505. That PR moved an OpenRouter video-catalog success JSON read from raw
response.json()to the shared bounded provider JSON reader. This patch applies the same guardrail to the ClickClack REST client boundary, where successful API responses were still parsed with rawresponse.json().Summary
readProviderJsonResponse.readResponseTextLimitedunchanged.Maintainer-ready fields
response.json()instead of OpenClaw's shared bounded provider JSON reader.await response.json()for every 2xx JSON response from the HTTP boundary.request<T>()helper, so changing that helper restores the response-size invariant at the boundary instead of patching individual call sites.Responseobject was used for the overflow/close proof.origin/main, ran the extensions Vitest shard, ranpnpm check:test-types, and ran the standalone ClickClack loopback proof script.error=ClickClack response: JSON response exceeds 16777216 bytes,exceeded_cap=true, andclosed_before_full_response=true.openclaw/plugin-sdk/provider-http; this change moves ClickClack's success JSON read onto that boundary before downstream typed response projection, matching the same shared reader pattern used by fix(openrouter): bound video catalog JSON reads #96505.extensions/clickclack/src/http-client.test.ts.merge-risk: low,behavior-change: oversized-provider-response, andauth-provideras a detected false-positive risk surface from editing the auth-bearing client file.What Problem This Solves
ClickClack REST responses come from an external service boundary. Before this patch, successful responses used native
response.json(), so an oversized or never-ending success body could be fully materialized before failing. The shared bounded JSON reader now enforces the existing 16 MiB provider JSON cap and cancels the stream once the cap is exceeded.Root Cause
The ClickClack client already bounded error response text through
readResponseTextLimited, but the shared REST success helper still returnedawait response.json(). Every successful ClickClack REST method flows through that helper, so the success path bypassed OpenClaw's provider response-size guardrail.Why it matters / User impact
An oversized ClickClack success response can otherwise consume memory through native JSON parsing before any ClickClack-specific shape validation runs. With this change, the client fails at the provider JSON cap with a deterministic overflow error and closes the response stream early.
What did NOT change
Architecture / source-of-truth check
OpenClaw already has a shared provider response-body source of truth in
openclaw/plugin-sdk/provider-http. ClickClack already used that module for bounded error text; this patch extends the same boundary helper to successful REST JSON responses instead of adding another local implementation.Target test file
extensions/clickclack/src/http-client.test.tsScenario locked in
The regression starts a local HTTP server, points the real ClickClack client at it, and streams an 18 MiB success JSON response. The client rejects at the shared 16 MiB cap and the server observes the connection closing before the full response is sent.
Evidence
RED observation against the raw
response.json()implementation:Loopback proof after the fix:
Real behavior proof
This proof uses a local TCP loopback HTTP server and the real ClickClack client, not a mocked
Response. The server attempts to stream 18 MiB; the client rejects once the shared 16 MiB cap is exceeded, and the server'scloseevent fires before the full body is sent.Verification
Full extensions Vitest shard after rebasing onto current
origin/main:Test typecheck:
Regression Test Plan
ClickClack response: JSON response exceeds 16777216 bytes.readResponseTextLimited.Why this is the smallest reliable guardrail
The ClickClack client funnels all REST success reads through one
request<T>()helper. Changing that one return path coversme, workspace/channel/message reads, direct-message creation, thread replies, and realtime event polling without touching call-site behavior.Merge risk
auth-provider, because the changed file is the ClickClack auth-bearing REST client.extensions/clickclackoverlap; public open-PR text search forclickclackdid not show a competing bounded ClickClack REST response-body PR.Risk labels considered
merge-risk: lowbehavior-change: oversized-provider-responseauth-providerdetected and explained aboveRisk explanation
The only intentional behavior change is for successful ClickClack JSON bodies over the shared provider cap: they now fail early with a bounded-reader error instead of continuing through raw native JSON parsing. Normal ClickClack REST payloads should be far smaller than 16 MiB.
Why acceptable
This matches the existing provider-response guardrail used elsewhere in OpenClaw and avoids creating a ClickClack-specific policy. The existing error-body limit and all public client method contracts are unchanged.
Maintainer-ready confidence
High. The patch is limited to the ClickClack REST response boundary, uses the shared bounded-reader helper, and has a real loopback proof that verifies both the overflow error and early stream close.
Patch quality notes
Competition / linked PR analysis
Fresh pre-submit comparison against Alix-007 open PRs found no ClickClack file overlap. The current Alix-007 open bounded-response work covers Runway, OpenAI video, Together/Pixverse, XAI, image generation, MiniMax, FAL, Vydra, Speech, OpenRouter, embedding, Mattermost, Nextcloud, Inworld, and Discord, but no
extensions/clickclackpath.A public open-PR text search for
clickclackreturned older docs/setup/config/channel PRs and did not show a bounded ClickClack REST response-body PR competing with this change.