From 33e6101032a74fbc643bd404fc6102f611288a97 Mon Sep 17 00:00:00 2001 From: uphiago <129319177+uphiago@users.noreply.github.com> Date: Sun, 2 Aug 2026 15:51:21 -0300 Subject: [PATCH] fix(hermes): preserve image prompt context --- config/hermes/gateway_entrypoint.py | 3 ++- skills/hermes/barbarossa-codex/SKILL.md | 5 +++-- tests/test-hermes-gateway.py | 2 ++ 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/config/hermes/gateway_entrypoint.py b/config/hermes/gateway_entrypoint.py index 6b8ee25..0fcac52 100644 --- a/config/hermes/gateway_entrypoint.py +++ b/config/hermes/gateway_entrypoint.py @@ -91,7 +91,8 @@ async def enrich_message_with_codex( return ( f"{user_text}\n\n" "[System: attached images were staged for isolated Codex vision. " - "Call media_image_inspect once for each path below, poll that job, " + "Call media_image_inspect once for each path below with the prompt " + "argument set to the full user request above verbatim, poll that job, " "and answer from its result. Do not call vision_analyze and do not " "use the terminal command `file` for these images.]\n" f"{paths}" diff --git a/skills/hermes/barbarossa-codex/SKILL.md b/skills/hermes/barbarossa-codex/SKILL.md index 32b1272..fdde90e 100644 --- a/skills/hermes/barbarossa-codex/SKILL.md +++ b/skills/hermes/barbarossa-codex/SKILL.md @@ -9,8 +9,9 @@ Stage every attachment beneath `/opt/data/barbarossa-transfer` before calling a Forge tool. Pass only staged absolute paths to the router. - For inbound image attachments already staged by the gateway, call - `media_image_inspect` immediately. Do not call `vision_analyze`, auxiliary - vision providers, or the terminal command `file`. + `media_image_inspect` immediately with the complete accompanying user + request as its `prompt`. Do not call `vision_analyze`, auxiliary vision + providers, or the terminal command `file`. - Use `code_delegate` for repository analysis, implementation, review, and tests. - Use `media_image_inspect` to understand an existing image. diff --git a/tests/test-hermes-gateway.py b/tests/test-hermes-gateway.py index 7ff8722..6680a02 100644 --- a/tests/test-hermes-gateway.py +++ b/tests/test-hermes-gateway.py @@ -47,6 +47,8 @@ def test_stage_inbound_images_is_private_and_builds_codex_instruction( assert os.stat(staged).st_mode & 0o777 == 0o600 assert str(staged) in message assert "media_image_inspect" in message + assert "prompt argument" in message + assert "full user request above verbatim" in message assert "vision_analyze" in message assert "command `file`" in message