Skip to content

feat: image.generate ws RPC for plugin surfaces - #85183

Merged
teknium1 merged 1 commit into
mainfrom
feat/image-generate-ws-rpc
Aug 13, 2026
Merged

teknium1 merged 1 commit into
mainfrom
feat/image-generate-ws-rpc

Conversation

@teknium1

Copy link
Copy Markdown
Collaborator

What

Adds image.generate ws JSON-RPC — the plugin-reachable twin of the image_generate model tool. Same pattern as profiles.list/profiles.create (#85093): desktop plugins only reach the backend through host.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} from check_image_generation_requirements() — lets UI show/hide a Generate button without spending a generation.
  • prompt + aspect_ratio → delegates to tools.image_generation_tool.image_generate_tool (whatever backend the user configured: FAL, OpenAI, plugin-provided, …).
  • Result carries both the backend's image ref AND image_data, a size-capped data URL of the downloaded bytes (default 8MB cap, max_bytes up 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 to image only.
  • Registered on the RPC pool (multi-second remote API round-trip; never on the WS reader thread).
  • No backend configured → soft {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 returned success: true, a hosted URL, and a ~5.9MB data: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).

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.
@github-actions

github-actions Bot commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

૮ >ﻌ< ა ci review

ran on a89d336 — feat: image.generate ws RPC for plugin surfaces

⚠️ Warnings

OSV vulnerability scan · View job

3 known vulnerabilities found in pinned dependencies.

How to fix:

Review the findings in the Security tab. Update the affected dependencies if a patched version is available.


debug info

CI timings

CI timings · View report · View job

Wall time 3m23s vs 7m (-51.7%). 14 job(s) slower, 8 faster, 2 unchanged.

  • Python tests / Run tests slice 6/12: -136.0s
  • Python tests / Run tests slice 2/12: +35.0s
  • Python tests / Run tests slice 7/12: +16.0s
  • Python tests / Run tests slice 4/12: +12.0s
  • Python tests / Run tests slice 5/12: +10.0s

@teknium1
teknium1 merged commit ccce697 into main Aug 13, 2026
45 checks passed
@teknium1
teknium1 deleted the feat/image-generate-ws-rpc branch August 13, 2026 09:30
@alt-glitch alt-glitch added type/feature New feature or request P3 Low — cosmetic, nice to have comp/tui Terminal UI (ui-tui/ + tui_gateway/) tool/vision Vision analysis and image generation labels Aug 13, 2026
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/tui Terminal UI (ui-tui/ + tui_gateway/) P3 Low — cosmetic, nice to have tool/vision Vision analysis and image generation type/feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants