Skip to content

feat(api-server): inline MEDIA: image tags as data URLs for remote frontends (#2696 salvage) - #777

Merged
hashbender merged 1 commit into
mainfrom
mirror/pr-56959
Jul 2, 2026
Merged

feat(api-server): inline MEDIA: image tags as data URLs for remote frontends (#2696 salvage)#777
hashbender merged 1 commit into
mainfrom
mirror/pr-56959

Conversation

@hashbender

Copy link
Copy Markdown
Owner

Summary

API-server responses now inline MEDIA:<path> image tags as base64 data URLs, so remote OpenAI-compatible frontends can actually render server-local screenshots and generated images instead of seeing dead file paths.

Salvage of the surviving piece of NousResearch#2696 by @tarunravi — the PR's other two changes (tool progress streaming, SSE None-sentinel fix) were independently superseded on main by the structured hermes.tool.progress SSE events and the rewritten queue-drain loop.

Changes

  • gateway/platforms/api_server.py: _resolve_media_to_data_urls() — inlines small (≤5MB) local images (png/jpg/jpeg/gif/webp/bmp) as markdown data URLs; non-image, missing, or oversized paths pass through untouched. Wired into all four response surfaces: chat completions (non-streaming), session chat, session chat stream final event, Responses API
  • tests/gateway/test_api_server_media_data_urls.py: 7 tests (inline, backtick-wrapped, missing file, non-image, oversized, multi-tag, passthrough)
  • scripts/release.py: AUTHOR_MAP entry for @tarunravi

Validation

Result
new tests 7/7 pass
tests/gateway/test_api_server_{normalize,multimodal,jobs}.py 81/81 pass
ruff clean

Infographic

infographic

Nous Research


Mirror-of: NousResearch#56959
NousResearch#56959

@hashbender
hashbender merged commit f1027db into main Jul 2, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant