#23154: feat(plugin): add image-strip extension
agents
size: L
Cluster:
Skill Enhancements and Fixes
Automatic image block stripping when model returns empty response.
## Features
- Replaces image content blocks with `[image omitted]` placeholder on empty model response
- In-memory stripping (`stripImageBlocksFromMessages`) and on-disk JSONL session file stripping (`stripImageBlocksFromSessionFile`)
- Removes empty assistant messages left by previous failed prompts
- Recursive handling of nested content (e.g. toolResult blocks)
## Split from
Previously part of agent-resilience (#22734), now an independent plugin.
## Tests
9 tests passing.
<!-- greptile_comment -->
<h3>Greptile Summary</h3>
Adds a new `image-strip` plugin that provides utilities to replace image content blocks with `[image omitted]` placeholders when models return empty responses. The implementation includes in-memory message stripping, on-disk JSONL session file stripping, and empty assistant message cleanup with recursive handling of nested content.
**Key issues found:**
- Configuration mismatch: `index.ts` uses `emptyPluginConfigSchema()` but `openclaw.plugin.json` defines `imageStripEnabled` and `imageStripPersist` properties - this will cause config validation to reject user configuration
- Health check returns hardcoded values instead of reading from actual config
- Non-null assertion on potentially undefined value in `stripImageBlocksFromSessionFile`
- Plugin exports utility functions but doesn't integrate them into the plugin lifecycle - the `register` function only provides health status without actually hooking into message processing events
<h3>Confidence Score: 2/5</h3>
- This PR has critical configuration issues that will prevent the plugin from working as documented
- Score reflects three critical logical errors: (1) config schema mismatch that will reject all user configuration, (2) hardcoded values that ignore user settings, and (3) non-null assertion that could throw on edge cases. The core utility functions are well-tested and sound, but the plugin integration is broken.
- Pay close attention to `extensions/image-strip/index.ts` - the configuration schema needs to match `openclaw.plugin.json` and the health check should read from actual config
<sub>Last reviewed commit: 10024d2</sub>
<!-- greptile_other_comments_section -->
<!-- /greptile_comment -->
Most Similar PRs
#22733: feat(plugin): add runner-extensions extension
by cintia09 · 2026-02-21
72.4%
#20499: test(plugins): add bundled+config duplicate discovery regression
by dcol91863 · 2026-02-19
71.3%
#2556: fix(plugin-install): handle existing plugins and filter workspace deps
by longmaba · 2026-01-27
71.2%
#5817: fix: strip old images during compaction to prevent 413 session bloat
by jduartedj · 2026-02-01
70.3%
#22735: feat(plugin): add feishu-media extension
by cintia09 · 2026-02-21
70.2%
#21660: fix(plugins): require explicit allowlist for non-bundled plugins
by AI-Reviewer-QS · 2026-02-20
70.1%
#7090: fix: plugin install uses manifest ID for folder name (#2796)
by dial481 · 2026-02-02
69.8%
#20424: Fix plugin extension path traversal in discovery/install
by markmusson · 2026-02-18
69.4%
#16966: fix: strip tool_use blocks from aborted/errored assistant messages
by StressTestor · 2026-02-15
69.3%
#10559: feat(security): add plugin output scanner for prompt injection dete...
by DukeDeSouth · 2026-02-06
69.3%