Files
CLIProxyAPI/sdk/pluginapi
Luis Pater 0fe38224e5 feat(pluginhost): support raw request body byte-range patching
Existing request interceptors wrap the full request body in a JSON RPC envelope with Base64 encoding and skip subsequent duplex WebSocket business frames, causing ~3.33x memory and CPU amplification when rewriting small fields such as Codex `<timezone>` and `<current_date>` in large contexts.

- Add schema v8 raw request body patch methods (`request.patch_body_before` and `request.patch_body_after`) and capabilities (`request_interceptor_patch_body_before/after`, `request_body_patcher_before/after`) that pass raw `Body []byte` directly across the C ABI without JSON/Base64 request wrapping
- Add `RequestBodyEdit`, `RequestBodyPatchResponse`, and `RequestBodyPatcher` in `sdk/pluginapi` with single-pass host splicing, bounds/overlap validation, `json.Valid` verification, no-op original body reuse, and sequential multi-plugin chaining
- Eliminate redundant full-body slice clones in handler/conductor request interceptor application paths
- Run before-auth and after-auth request interceptors on subsequent duplex WebSocket `response.create`, `response.append`, and `response.steer` messages

Closes: #7072
2026-10-28 21:38:42 +08:00
..