#18706: fix(nano-banana-pro): remove space after MEDIA: token
stale
size: XS
Cluster:
Media Handling Improvements
## Summary
The `generate_image.py` script in the `nano-banana-pro` skill prints `MEDIA: /path` (with a space after the colon), which does not match the canonical `MEDIA:/path` format used by all other skills and tested throughout the codebase.
## Problem
OpenClaw's `splitMediaFromOutput` parser (in `src/media/parse.ts`) and `extractToolResultMediaPaths` (in `src/agents/pi-embedded-subscribe.tools.ts`) extract media file paths from lines starting with `MEDIA:`. While the regex `MEDIA:\s*` tolerates an optional space, every other skill and test uses the no-space format:
- `openai-image-gen` outputs paths without the space
- `pi-embedded-subscribe.tools.media.test.ts` tests `MEDIA:/tmp/screenshot.png` (no space)
- `media/parse.test.ts` tests `MEDIA:/Users/pete/My File.png` (no space)
The space caused inconsistency and could interact poorly with downstream consumers that expect the canonical format.
## Changes
- **`skills/nano-banana-pro/scripts/generate_image.py`**: Changed `print(f"MEDIA: {full_path}")` to `print(f"MEDIA:{full_path}")`
- Updated the comment to clarify the no-space, line-start format constraint
## Testing
- Verified the change matches the format in `SKILL.md` ("The script prints a `MEDIA:` line")
- Confirmed alignment with all existing tests in the codebase
<!-- greptile_comment -->
<h3>Greptile Summary</h3>
Fixes the `MEDIA:` token format in `nano-banana-pro`'s `generate_image.py` by removing the space after the colon, aligning it with the canonical `MEDIA:{path}` format used by every other media token producer in the codebase (`tts-tool.ts`, `nodes-tool.ts`, `common.ts`) and expected by all tests.
- Removed trailing space in `print(f"MEDIA: {full_path}")` → `print(f"MEDIA:{full_path}")` in `generate_image.py:174`
- Updated the inline comment to document the no-space, line-start format constraint
- The `MEDIA_TOKEN_RE` regex in `src/media/parse.ts` tolerates optional whitespace via `\s*`, so the old format worked but was inconsistent with all other producers and tests
<h3>Confidence Score: 5/5</h3>
- This PR is safe to merge — it's a minimal one-line format fix that aligns with all existing conventions.
- The change is a trivial, well-motivated format fix: removing a single space in a print statement to match the canonical MEDIA token format used everywhere else. The parser already handles both formats, so there is zero risk of breakage. The comment update is accurate and helpful.
- No files require special attention.
<sub>Last reviewed commit: 80174c8</sub>
<!-- greptile_other_comments_section -->
<sub>(2/5) Greptile learns from your feedback when you react with thumbs up/down!</sub>
<!-- /greptile_comment -->
Most Similar PRs
#18890: fix(media): parse tool-result MEDIA directives with shared parser
by teededung · 2026-02-17
75.8%
#18811: fix(media): require file extension for ambiguous MEDIA: path detection
by aldoeliacim · 2026-02-17
75.1%
#19868: fix: prevent media token regex from matching markdown bold text
by sanketgautam · 2026-02-18
75.0%
#14794: fix: parse inline MEDIA: tokens in agent replies
by explainanalyze · 2026-02-12
74.8%
#19399: telegram: fix MEDIA false positives and partial final drop
by HOYALIM · 2026-02-17
73.0%
#21745: tools: fix image inbound resolution and empty allowBundled
by AIflow-Labs · 2026-02-20
71.1%
#21110: fix(tts): deliver audio via structured mediaUrl instead of MEDIA: t...
by hydro13 · 2026-02-19
71.0%
#23079: fix(skills): fallback to npm for summarize skill on non-darwin systems
by charojo · 2026-02-22
70.6%
#8014: fix(media-understanding): support legacy {file} placeholder in CLI ...
by Glucksberg · 2026-02-03
70.5%
#20735: fix: skip auto-attaching tool MEDIA: paths already sent via message t…
by anillBhoi · 2026-02-19
70.4%