Conversation
8bcb090 to
2493953
Compare
teknium1
left a comment
There was a problem hiding this comment.
Thanks for the xAI API refresh work. The useful provider changes need a targeted salvage onto current main rather than a direct merge.
Problems
agent/image_gen_provider.py:479adds a local-file read path withoutraise_if_read_blocked;plugins/image_gen/xai/__init__.py:234reaches it. Current main guards xAI reads atplugins/image_gen/xai/__init__.py:140-145(commitc1826e269) and tests that blocked credentials are never opened.tools/image_edit_tool.py:57-60checks any available edit provider, but dispatch at:82-85uses only the active provider. This can expose a tool that necessarily returnsunsupported_capability.- Current main already deliberately unifies image editing under
image_generate(agent/image_gen_provider.py:16-24, commitc02192ff6); addingimage_editto_HERMES_CORE_TOOLSduplicates that model-facing surface. - The provider rewrite must retain current
image_gen.xai.storagebehavior atplugins/image_gen/xai/__init__.py:289-333.
Suggested changes
- Rebase the provider changes conceptually onto the unified
image_generatepath, preserve current storage and file-safety behavior, and add the active-provider availability test.
Automated hermes-sweeper review.
| f"Image file exceeds {max_bytes // (1024 * 1024)}MB cap: {path}" | ||
| ) | ||
|
|
||
| raw = p.read_bytes() |
There was a problem hiding this comment.
This reads a model-supplied path without agent.file_safety.raise_if_read_blocked. Current main guards xAI local-image reads before opening them (plugins/image_gen/xai/__init__.py:140-145, c1826e269); put that guard in this shared helper before any filesystem access and add a no-read credential-store regression test.
| from hermes_cli.plugins import _ensure_plugins_discovered | ||
|
|
||
| _ensure_plugins_discovered() | ||
| for provider in list_providers(): |
There was a problem hiding this comment.
Availability is based on any discovered provider, but dispatch later uses only get_active_provider(). If xAI is available while the selected provider cannot edit, this exposes image_edit for a guaranteed unsupported-capability response. Resolve and check the active provider here instead.
|
|
||
| # Optional storage_options pass-through (FR7). Validated for safe shape; | ||
| # default-off and never adds public_url on the caller's behalf. | ||
| storage_options = kwargs.get("storage_options") |
There was a problem hiding this comment.
Please preserve the current config-driven image_gen.xai.storage path when salvaging this rewrite. Current main builds and sends configured storage options by default at plugins/image_gen/xai/__init__.py:289-333; accepting only direct kwargs would silently drop that existing behavior.
|
Thanks for the thorough work here, @jovijovi — closing after review, with two reasons:
Appreciate the contribution — the editing capability is live and your PR helped map the requirements. |
Summary
Updates the existing xAI image PR into a current upstream-clean patch on top of
NousResearch/hermes-agent:main.This PR now adds:
image_edittool surface for edit-capable image providers;supports_edit()/edit(...)contract withunsupported_capabilityfallback for generate-only providers;grok-imagine-image-quality;resolutionhonored for both generation and edit paths;response_format: b64_jsonto avoid depending on ephemeralimgen.x.aiURLs;file_id, multi-image edit up to 3 inputs;nandstorage_optionssupport with privacy-default validation;Compatibility notes:
image_generate(image_url=..., reference_image_urls=...)contract by routing xAI image inputs through the same edit implementation.image_editis exposed in theimage_gentoolset and gated at runtime by provider support.Verification
Hermes local gates on the rebuilt branch:
Independent read-only review:
modality="image"; direct edit andimage_generate(image_url=...)have regression coverage.Scope hygiene
This update intentionally excludes downstream-only Sachima roadmap/dev-log/runtime-rollout evidence, local media/cache artifacts, private profiles, credentials, and local workspace paths.