Repository navigation
fix(plugin-net): support bounded binary responses - #2485
Conversation
Add an opt-in base64 response mode for plugin net.fetch so media plugins can download bounded binary results through the existing host permission and redirect controls. Preserve text responses and advertise the capability for older-host checks. Cover the IPC path, size enforcement, byte metadata, SDK types, API documentation, and the accepted architecture decision with a focused regression suite.
Make the optional binary response limit type-safe under the Desktop strict TypeScript configuration. Preserve the existing runtime validation and error behavior while allowing the CI typecheck to complete.
|
Thanks for the contribution. I reviewed this as a Under the current temporary contribution policy (AGENTS.md §15), outside contributions are limited to If you resubmit, please also keep the existing |
…tract docs The SDK still typed net.getCapabilities with the old redirect-only shape, so plugins could not read the new binaryResponseBody flag without a cast. The host now advertises the shared size constant instead of a duplicated literal. The spec rewrite also dropped still-valid guidance: older hosts ignore unknown fetch options, so passing an option is not capability detection, and failed calls are audited with their advertised retryAfter. Restore both alongside the binary-mode text.
|
Reopened after review: merged on its merits. I pushed one small landing commit (5264171): typed |
Summary
Add an opt-in bounded binary response mode to the plugin host network API so approved plugins can download media through the existing permission, allowlist, redirect, timeout, and audit controls.
Changes
responseType: "base64"andmaxResponseBytestopi.net.fetch.Verification
pnpm check:pr-basepnpm --filter @pi-desktop/plugin-sdk buildnode --test apps/desktop/test/plugin-fetch-redirect.test.mjswith Node 22.22.1This is the Host prerequisite for the ComfyUI media workflow plugin change. No real provider or ComfyUI service was contacted.