From 86a89d96d7cb22048a3528462ad2e10907f9b032 Mon Sep 17 00:00:00 2001 From: ABFS Tech <82096803+QuantDeveloperUSA@users.noreply.github.com> Date: Fri, 6 Mar 2026 10:29:06 -0500 Subject: [PATCH] fix(nano-banana-pro): remove space after MEDIA: token in generate_image.py (#18706) The MEDIA: output token must appear at line start with no space after the colon for OpenClaw's splitMediaFromOutput parser to extract the file path and auto-attach media on outbound chat channels (Discord, Telegram, WhatsApp, etc.). The script was printing 'MEDIA: /path' (with space), which while tolerated by the regex, does not match the canonical 'MEDIA:/path' format used by all other skills (e.g. openai-image-gen) and tested in the codebase (pi-embedded-subscribe.tools.media.test.ts, media/parse.test.ts). Also updated the comment to clarify the format constraint. --- skills/nano-banana-pro/scripts/generate_image.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/skills/nano-banana-pro/scripts/generate_image.py b/skills/nano-banana-pro/scripts/generate_image.py index cb470b384c9..e13502e08bd 100755 --- a/skills/nano-banana-pro/scripts/generate_image.py +++ b/skills/nano-banana-pro/scripts/generate_image.py @@ -192,8 +192,9 @@ def main(): if image_saved: full_path = output_path.resolve() print(f"\nImage saved: {full_path}") - # OpenClaw parses MEDIA tokens and will attach the file on supported providers. - print(f"MEDIA: {full_path}") + # OpenClaw parses MEDIA: tokens (line-start, no space after colon) + # and will attach the file on supported chat providers. + print(f"MEDIA:{full_path}") else: print("Error: No image was generated in the response.", file=sys.stderr) sys.exit(1)