← Back to PRs

#23154: feat(plugin): add image-strip extension

by cintia09 open 2026-02-22 02:34 View on GitHub →
agents size: L
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