Repository navigation
fix(compliance): bound agent response size during hosted compliance runs - #8187
Conversation
Hosted compliance calls untrusted agents with no response size limit. On 2026-10-13 one seller answered a get_products refine request with a 17.8 MB body (26,163 proposals). Processing it pushed the worker past 10 GB RSS and the kernel OOM-killed it. Because the heartbeat claims a batch before running it, every agent in that batch lost its run, and the cycle repeated on each re-claim. All hosted compliance SDK calls now go through one helper that sets transport.maxResponseBytes to 4 MiB unless the caller set a bound. That matches the cap capability discovery already uses. An oversized reply now fails that agent's step instead of the worker. Reproduced locally against the same agent: peak RSS 10.5-10.9 GB without the bound, 1.6 GB with it. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
There was a problem hiding this comment.
Ladon verdict: Approve
Approve — bounds hosted compliance SDK responses to 4 MiB at all five hosted SDK call sites to fix the reported 17.8 MB OOM incident.
Checked: caller-supplied bounds preserved, deadline/timeout signals present, fetch-boundary enforcement, and changeset scope (server-only operational path, not protocol surface — no changeset required). Clean, empirically validated fix.
Medium findings (non-blocking):
- server/src/addie/services/compliance-testing.ts:74 — Response cap relies on SDK
maxResponseBytes, which excludes SSE tool responses;comply()requeststext/event-stream, leaving an SSE-delivered oversized reply able to OOM the heartbeat worker.
Decision rationale: No critical/high findings (row 1 n/a). gated_paths is false (row 2 n/a). high_risk is true but the only reason is a (modified) file — row 5 requires a medium finding on the modified file AND it fires only together; row 5 does apply here: high_risk=true + (modified) + a medium finding. Re-checking: row 5 condition is met.
Medium findings
- server/src/addie/services/compliance-testing.ts:74 — Response cap relies on SDK maxResponseBytes, which excludes SSE tool responses
|
Note on the cap's coverage: this passes the SDK's The real fix belongs in the SDK: adcontextprotocol/adcp-client#3253. Cross-SDK default and spec wording: #8190. |
Problem
Hosted compliance calls untrusted agents with no response-size limit. On 2026-10-13, one seller answered a
get_productsrefine request (media_buy_seller/refine_products) with a 17.8 MB body containing 26,163 proposals for 7 products. While the SDK processed it, the worker's RSS went past 10 GB, and the kernel OOM-killed it (exit_code=137, oom_killed=true).The heartbeat claims its whole batch before running it, so each crash also dropped every other agent in the batch. Six agents went 7–9 days without a recorded run. #8188 fixes that claim-recovery gap separately.
Fix
Every hosted compliance SDK call in
compliance-testing.tsnow goes throughwithHostedComplianceTransport. The helper setstransport.maxResponseBytesto 4 MiB unless the caller already set a bound, which matches the capcapabilities.tsuses for discovery. An oversized reply now fails that agent's step; the worker keeps running.Evidence
I ran the hosted
comply()path locally against the same agent, single storyboard, and measured peak RSS with/usr/bin/time -l:--no-maglev, no boundThe growth is native memory, not JS heap: the heap stayed under about 900 MB. Native stack samples are dominated by V8 Maglev compilation and deopt work while the response is processed. Underneath that is a Maglev memory pathology, which this PR does not fix. Bounding untrusted input is the right control either way.
Tests
comply()hands the SDK the bound for the run and for its capability pre-discovery, and a caller-supplied bound is kept. I checked that the test fails when the default is removed.🤖 Generated with Claude Code