feat: image.generate ws RPC for plugin surfaces - #85183
Merged
Merged
Conversation
Desktop plugins reach the backend only through ws JSON-RPC; image
generation existed solely as a model tool, so plugin UI (avatar pickers,
artifact panes) could not generate images. image.generate delegates to
the configured image_generate backend, supports probe:true for cheap
availability checks, and returns the result as both the backend ref and
a size-capped data URL — remote-gateway clients cannot read gateway-host
file paths and hosted URLs are often CORS-opaque, so the data URL works
identically over local and remote gateways. Pool-dispatched; missing
backend degrades to a soft {available:false} instead of an RPC error.
Contributor
૮ >ﻌ< ა ci reviewran on a89d336 — feat: image.generate ws RPC for plugin surfaces
|
skappafrost
pushed a commit
to skappafrost/hermes-agent
that referenced
this pull request
Aug 15, 2026
Desktop plugins reach the backend only through ws JSON-RPC; image
generation existed solely as a model tool, so plugin UI (avatar pickers,
artifact panes) could not generate images. image.generate delegates to
the configured image_generate backend, supports probe:true for cheap
availability checks, and returns the result as both the backend ref and
a size-capped data URL — remote-gateway clients cannot read gateway-host
file paths and hosted URLs are often CORS-opaque, so the data URL works
identically over local and remote gateways. Pool-dispatched; missing
backend degrades to a soft {available:false} instead of an RPC error.
melon-xf
added a commit
to melon-xf/hermes-agent
that referenced
this pull request
Sep 3, 2026
Desktop plugins reach the backend only through ws JSON-RPC; image
generation existed solely as a model tool, so plugin UI (avatar pickers,
artifact panes) could not generate images. image.generate delegates to
the configured image_generate backend, supports probe:true for cheap
availability checks, and returns the result as both the backend ref and
a size-capped data URL — remote-gateway clients cannot read gateway-host
file paths and hosted URLs are often CORS-opaque, so the data URL works
identically over local and remote gateways. Pool-dispatched; missing
backend degrades to a soft {available:false} instead of an RPC error.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds
image.generatews JSON-RPC — the plugin-reachable twin of theimage_generatemodel tool. Same pattern asprofiles.list/profiles.create(#85093): desktop plugins only reach the backend throughhost.request, and image generation existed solely as a model tool, so no plugin UI (avatar pickers, artifact panes) could generate an image.probe: true→{available}fromcheck_image_generation_requirements()— lets UI show/hide a Generate button without spending a generation.prompt+aspect_ratio→ delegates totools.image_generation_tool.image_generate_tool(whatever backend the user configured: FAL, OpenAI, plugin-provided, …).imageref ANDimage_data, a size-capped data URL of the downloaded bytes (default 8MB cap,max_bytesup to 16MB). Rationale: a remote-gateway client can't read a file path on the gateway host, and hosted result URLs are frequently CORS-opaque to a renderer — the data URL works identically over local and remote gateways. Download failure degrades toimageonly.{available: false, success: false, error}rather than a JSON-RPC error, so callers can branch without try/catch.Verification
Exercised against the real registry with the live FAL backend: probe returned
{available: true}; a real generation returnedsuccess: true, a hosted URL, and a ~5.9MBdata:image/png;base64,…payload. No-backend path returns the soft-unavailable shape (checked by forcing the availability probe false).First consumer: the hermes-bots roster plugin's avatar picker (generate-an-avatar + upload-from-device).