feat: inline image detection and tool result string format fix#355
Merged
jalehman merged 2 commits intoApr 11, 2026
Merged
Conversation
1. Detect and externalize base64 image data (JPEG, PNG, GIF, WebP, SVG) in messages of any role (user/tool/assistant). Images are saved as binary files. Handles both OpenClaw "[media attached:]" user pattern and pure base64 payloads in any message content. 2. Normalize string-format tool result content to array before processing so large string tool outputs are properly externalized. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Route externalized payloads through a shared large-files directory, add largeFilesDir/LCM_LARGE_FILES_DIR to the config surface, and prevent already-externalized image references from being re-routed through the generic large tool-result text externalizer. Add focused regressions for inline image storage, structured tool-result image payloads, string-content tool-result image payloads, and the new config resolution path. Sync the plugin schema, docs, skill reference, and add a changeset for the user-visible behavior. Regeneration-Prompt: | Address the PR review findings on inline image externalization in lossless-claw. Keep the change additive and local: preserve the existing large tool-result externalization behavior for real text payloads, but stop tool-result image references from being externalized a second time as .txt files. Make tool-message image detection operate on the original message shape so structured tool_result/function_call_output payloads still round-trip through message_parts and assembly. Also stop hard-coding the large-files storage location by introducing a configurable largeFilesDir with an LCM_LARGE_FILES_DIR env override, then sync the manifest, docs, skill reference, tests, and release notes entry so the new storage behavior is fully documented.
6e37c1b to
3e60bdd
Compare
Contributor
|
Thank you! |
This was referenced Apr 11, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
[media attached:]user pattern and pure base64 payloads in any message content. Image detection is a standalone system independent of the large file text pipeline.Test plan
🤖 Generated with Claude Code