Repository navigation
refactor(infra): consolidate bounded HTTP body reads - #99744
Conversation
|
Codex review: needs maintainer review before merge. Reviewed July 4, 2026, 2:50 PM ET / 18:50 UTC. Summary PR surface: Source +9, Tests -18, Config -11, Other -9. Total -29 across 40 files. Reproducibility: not applicable. This PR is an owner-boundary refactor of an existing bounded response-reader, not a bug report with a failing user reproduction path. Review metrics: 1 noteworthy metric.
Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Risk before merge
Maintainer options:
Next step before merge
Security Review detailsBest possible solution: Land the refactor only after owner/security review confirms the private media-core subpath removal is intentional and the documented Do we have a high-confidence way to reproduce the issue? Not applicable; this PR is an owner-boundary refactor of an existing bounded response-reader, not a bug report with a failing user reproduction path. Is this the best way to solve the issue? Yes, the owner-boundary shape looks maintainable: shared Web AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 5304d006e5f6. Label changesLabel justifications:
Evidence reviewedPR surface: Source +9, Tests -18, Config -11, Other -9. Total -29 across 40 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
|
ca29db5 to
b5ed973
Compare
b5ed973 to
b37b780
Compare
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
b37b780 to
d5430dc
Compare
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
* refactor(infra): consolidate bounded HTTP body reads * fix(plugin-sdk): preserve HTTP body export boundaries
What Problem This Solves
Bounded HTTP response reads were owned by the private media package even though the primitive is transport infrastructure used across agents, gateway, plugins, media, and provider flows. That left HTTP lifecycle behavior coupled to a media-domain package and duplicated its ownership alongside request-body handling.
Why This Change Was Made
Moves the existing exact Web
Responsebyte-limit implementation intosrc/infra/http-body.ts, preserving overflow, idle-timeout, cancellation, reader-lock, fallback, decoding, and caller-provided error behavior. Core callers and the existing Plugin SDK facades now use the infra owner; JSON/text interpretation, status handling, retries, logging, and provider policy remain with callers. The private@openclaw/media-core/read-response-with-limitsubpath and its build/alias scaffolding are removed.The deprecated
plugin-sdk/infra-runtimebarrel is pinned to its pre-existing request-body exports so the relocated response readers remain available only through the focusedresponse-limit-runtimeand existingmedia-runtimesurfaces.User Impact
No user-visible behavior change. Maintainers and plugin authors keep the same supported Plugin SDK response-limit APIs, with one canonical core owner for bounded HTTP request and response reads.
Evidence
b5ed973ce800463d49e27067c620682f4c7f6657.checks-node-compact-small-whole-2on the prior head failed deterministically intest/scripts/plugin-sdk-surface-report.test.ts; the relocation made existing package-backed exports source-resolvable and accidentally leaked two response readers through deprecatedinfra-runtime. This was branch-caused, not flaky or unrelated.infra-runtimenow preserves its exact prior request-body surface; source budgets are pinned to 10,414 public exports, 5,230 callable exports, and a reduced 212 wildcard re-exports.node scripts/run-vitest.mjs test/scripts/plugin-sdk-surface-report.test.ts src/infra/http-body.test.ts src/infra/http-body.response.test.ts src/plugins/sdk-alias.test.ts src/plugins/contracts/plugin-sdk-subpaths.test.ts— 4 shards passed, 126 tests.pnpm build— passed, including tsdown, Plugin SDK export checks, runtime postbuild, and Control UI build.tbx_01kwndqmfeptbxbstfh2t85yy0—pnpm check:changedpassed full typecheck, core/extensions/scripts lint, guards, and runtime import-cycle checks..agents/skills/autoreview/scripts/autoreview --mode local --prompt-file tmp/notes.md --stream-engine-output— clean; no accepted/actionable findings, correctness confidence 0.98.